View Javadoc

1   /**
2    *
3    * Copyright 2003-2004 The Apache Software Foundation
4    *
5    *  Licensed under the Apache License, Version 2.0 (the "License");
6    *  you may not use this file except in compliance with the License.
7    *  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   *  Unless required by applicable law or agreed to in writing, software
12   *  distributed under the License is distributed on an "AS IS" BASIS,
13   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   *  See the License for the specific language governing permissions and
15   *  limitations under the License.
16   */
17  
18  package org.apache.geronimo.deployment;
19  
20  import java.io.File;
21  import java.io.IOException;
22  import java.util.Collection;
23  import java.util.List;
24  import java.util.jar.JarFile;
25  
26  import org.apache.geronimo.common.DeploymentException;
27  import org.apache.geronimo.deployment.DeploymentContext;
28  import org.apache.geronimo.kernel.config.ConfigurationStore;
29  import org.apache.geronimo.kernel.repository.Artifact;
30  import org.apache.geronimo.kernel.repository.ArtifactResolver;
31  
32  /**
33   * @version $Rev: 432510 $ $Date: 2006-08-18 00:44:04 -0700 (Fri, 18 Aug 2006) $
34   */
35  public interface ConfigurationBuilder {
36      static final String CONFIG_BUILDER = "ConfigBuilder";
37  
38      /**
39       * Builds a deployment plan specific to this builder from a planFile and/or
40       * module if this builder can process it.
41       * @param planFile the deployment plan to examine; can be null
42       * @param module the URL of the module to examine; can be null
43       * @return the deployment plan, or null if this builder can not handle the module
44       * @throws org.apache.geronimo.common.DeploymentException if there was a problem with the configuration
45       */
46      Object getDeploymentPlan(File planFile, JarFile module, ModuleIDBuilder idBuilder) throws DeploymentException;
47  
48      /**
49       * Checks what configuration URL will be used for the provided module.
50       * @param plan the deployment plan
51       * @param module the module to build
52       * @return the ID that will be used for the Configuration
53       * @throws IOException if there was a problem reading or writing the files
54       * @throws org.apache.geronimo.common.DeploymentException if there was a problem with the configuration
55       */
56      Artifact getConfigurationID(Object plan, JarFile module, ModuleIDBuilder idBuilder) throws IOException, DeploymentException;
57  
58      /**
59       * Build a configuration from a local file
60       *
61       * @param inPlaceDeployment true if the deployment is in-place.
62       * @param plan the deployment plan
63       * @param module the module to build
64       * @param configurationStores
65       * @param artifactResolver
66       * @param targetConfigurationStore
67       * @return the deployment context created from the deployment (the contexts must be closed by the caller)
68       * @throws IOException if there was a problem reading or writing the files
69       * @throws org.apache.geronimo.common.DeploymentException if there was a problem with the configuration
70       */
71      DeploymentContext buildConfiguration(boolean inPlaceDeployment, Artifact configId, Object plan, JarFile module, Collection configurationStores, ArtifactResolver artifactResolver, ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException;
72  }