jboynes     2004/02/18 17:51:44

  Modified:    modules/deployment/src/java/org/apache/geronimo/deployment
                        ConfigurationBuilder.java Deployer.java
               
modules/deployment/src/java/org/apache/geronimo/deployment/service
                        ServiceConfigBuilder.java
  Log:
  Allow passing of module to ConfigurationBuilder
  
  Revision  Changes    Path
  1.2       +18 -2     
incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java
  
  Index: ConfigurationBuilder.java
  ===================================================================
  RCS file: 
/home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ConfigurationBuilder.java 12 Feb 2004 18:27:39 -0000      1.1
  +++ ConfigurationBuilder.java 19 Feb 2004 01:51:44 -0000      1.2
  @@ -57,6 +57,8 @@
   
   import java.io.IOException;
   import java.io.File;
  +import java.net.URL;
  +import java.util.jar.JarInputStream;
   
   import org.apache.xmlbeans.XmlObject;
   
  @@ -66,6 +68,20 @@
    * @version $Revision$ $Date$
    */
   public interface ConfigurationBuilder {
  +    /**
  +     * Determine if this builder can handle the supplied plan.
  +     * @param plan the plan to examine
  +     * @return true if this builder will handle it
  +     */
       boolean canConfigure(XmlObject plan);
  -    void buildConfiguration(File outfile, XmlObject plan, boolean install) 
throws IOException, DeploymentException;
  +
  +    /**
  +     * Extract the deployment plan from a module if this builder can
  +     * process it.
  +     * @param module the URL of the module to examine
  +     * @return the deployment plan, or null if this module can not handle it
  +     */
  +    XmlObject getDeploymentPlan(URL module);
  +
  +    void buildConfiguration(File outfile, JarInputStream module, XmlObject 
plan, boolean install) throws IOException, DeploymentException;
   }
  
  
  
  1.4       +6 -2      
incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
  
  Index: Deployer.java
  ===================================================================
  RCS file: 
/home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Deployer.java     13 Feb 2004 15:48:26 -0000      1.3
  +++ Deployer.java     19 Feb 2004 01:51:44 -0000      1.4
  @@ -126,7 +126,7 @@
               saveOutput = true;
           }
           try {
  -            builder.buildConfiguration(cmd.carfile, plan, cmd.install);
  +            builder.buildConfiguration(cmd.carfile, null, plan, cmd.install);
           } finally {
               if (!saveOutput) {
                   cmd.carfile.delete();
  @@ -219,6 +219,10 @@
               command.module = cmd.hasOption('m') ? 
getURL(cmd.getOptionValue('m')) : null;
           } catch (MalformedURLException e) {
               System.err.println("Invalid URL for module: 
"+cmd.getOptionValue('m'));
  +            return null;
  +        }
  +        if (command.module == null && command.plan == null) {
  +            System.err.println("No plan or module specified");
               return null;
           }
           try {
  
  
  
  1.3       +7 -2      
incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
  
  Index: ServiceConfigBuilder.java
  ===================================================================
  RCS file: 
/home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ServiceConfigBuilder.java 12 Feb 2004 23:22:19 -0000      1.2
  +++ ServiceConfigBuilder.java 19 Feb 2004 01:51:44 -0000      1.3
  @@ -72,6 +72,7 @@
   import java.util.jar.Attributes;
   import java.util.jar.JarOutputStream;
   import java.util.jar.Manifest;
  +import java.util.jar.JarInputStream;
   import javax.management.MalformedObjectNameException;
   import javax.management.ObjectName;
   
  @@ -115,7 +116,11 @@
           return plan instanceof ConfigurationDocument;
       }
   
  -    public void buildConfiguration(File outfile, XmlObject plan, boolean 
install) throws IOException, DeploymentException {
  +    public XmlObject getDeploymentPlan(URL module) {
  +        return null;
  +    }
  +
  +    public void buildConfiguration(File outfile, JarInputStream module, 
XmlObject plan, boolean install) throws IOException, DeploymentException {
           ConfigurationType configType = ((ConfigurationDocument) 
plan).getConfiguration();
           URI configID;
           try {
  
  
  

Reply via email to