geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject cvs commit: incubator-geronimo/modules/kernel/src/java/org/apache/geronimo Geronimo.java
Date Wed, 28 Jan 2004 23:03:22 GMT
djencks     2004/01/28 15:03:22

  Modified:    modules/maven-plugin project.xml
               .        maven.xml
               modules/kernel/src/java/org/apache/geronimo Geronimo.java
  Log:
  Revert Geronimo class and supply equivalent functionality from maven scripting
  
  Revision  Changes    Path
  1.3       +11 -1     incubator-geronimo/modules/maven-plugin/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/maven-plugin/project.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project.xml	26 Jan 2004 06:50:47 -0000	1.2
  +++ project.xml	28 Jan 2004 23:03:22 -0000	1.3
  @@ -51,6 +51,15 @@
                   <classloader>root</classloader>
               </properties>
           </dependency>
  +<!-- TODO remove this stupid dependency -->
  +        <dependency>
  +            <groupId>geronimo</groupId>
  +            <artifactId>geronimo-core</artifactId>
  +            <version>DEV</version>
  +            <properties>
  +                <classloader>root</classloader>
  +            </properties>
  +        </dependency>
   
           <dependency>
               <id>commons-logging</id>
  @@ -79,7 +88,8 @@
           </dependency>
   
           <dependency>
  -            <id>cglib+full</id>
  +            <groupId>cglib</groupId>
  +            <artifactId>cglib-full</artifactId>
               <version>2.0-RC2</version>
               <url>http://cglib.sourceforge.net</url>
               <properties>
  
  
  
  1.62      +68 -278   incubator-geronimo/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/maven.xml,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- maven.xml	28 Jan 2004 10:29:56 -0000	1.61
  +++ maven.xml	28 Jan 2004 23:03:22 -0000	1.62
  @@ -14,42 +14,6 @@
   
       <j:set var="release.id" value="${pom.standardToLegacyId(pom.id)}-${pom.currentVersion}"/>
   
  -    <goal name="deploy:server">
  -        <j:set var="g.repo" value="${maven.repo.local}/geronimo/jars"/>
  -        <ant:echo message="in deploy:server"/>
  -        <deploy:deploy
  -            deployconfigid="org/apache/geronimo/Server"
  -            deployoutfile="target/Server.car"
  -            deployurl="${g.repo}/geronimo-security-package-DEV.jar,${g.repo}/geronimo-transaction-package-DEV.jar,${g.repo}/geronimo-connector-package-DEV.jar"/>
  -        <ant:echo message="did deploy:server"/>
  -    </goal>
  -
  -    <goal name="install:server">
  -        <ant:echo message="in install:server"/>
  -        <deploy:install
  -            installDomain="geronimo"
  -            installStoreDir="target/localConfigStore"
  -            installConfig="target/Server.car"/>
  -        <ant:echo message="did install:server"/>
  -    </goal>
  -
  -    <goal name="load:server">
  -        <ant:echo message="in load:server"/>
  -        <deploy:loadAndReturn
  -            runDomain="geronimo"
  -            runStoreDir="target/localConfigStore"
  -            runConfigID="org/apache/geronimo/Server"/>
  -        <ant:echo message="did load:server"/>
  -    </goal>
  -
  -    <goal name="loadAndWait:server">
  -        <ant:echo message="in loadAndWait:server"/>
  -        <deploy:loadAndWait
  -            runDomain="geronimo"
  -            runStoreDir="target/localConfigStore"
  -            runConfigID="org/apache/geronimo/Server"/>
  -        <ant:echo message="did loadAndWait:server"/>
  -    </goal>
       <!-- ======= -->
       <!-- Modules -->
       <!-- ======= -->
  @@ -185,9 +149,9 @@
               <j:set var="reactorProjects" value="${reactorProjects}" scope="parent"/>
   
               <!-- Optionaly perform module aggregation -->
  -            <j:if test="${context.getVariable('modules.aggregate.skip') != 'true'}">
  +            <!--j:if test="${context.getVariable('modules.aggregate.skip') != 'true'}">
                   <attainGoal name="modules:aggregate"/>
  -            </j:if>
  +            </j:if-->
           </define:tag>
   
       </define:taglib>
  @@ -255,7 +219,7 @@
   
       <goal name="aggregate">
           <attainGoal name="modules:reactor"/>
  -        <attainGoal name="modules:aggregate"/>
  +        <!--attainGoal name="modules:aggregate"/-->
       </goal>
   
       <!-- Helper tags for module aggregation -->
  @@ -405,53 +369,6 @@
       <!-- Module Output Aggregation Hooks -->
       <!-- =============================== -->
   
  -    <goal name="modules:aggregate:default">
  -        <aggregate:default/>
  -    </goal>
  -
  -    <goal name="modules:aggregate:geronimo:geronimo-web">
  -        <!-- Do not do the default libraries stuff -->
  -        <aggregate:default libraries="false"/>
  -
  -        <!-- Put geronimo-web into deploy/jetty/lib -->
  -        <aggregate:copy
  -            source="${module.root}/target"
  -            target="${aggregate.dir}/deploy/jetty/lib"
  -            include="*.jar"/>
  -    </goal>
  -
  -    <goal name="modules:aggregate:geronimo:geronimo-kernel">
  -        <!-- Do not do the default libraries stuff -->
  -        <aggregate:default libraries="false"/>
  -
  -        <!-- Put geronimo-kernel into deploy/bootlib -->
  -        <aggregate:copy
  -            source="${module.root}/target"
  -            target="${aggregate.dir}/bootlib"
  -            include="*.jar"/>
  -    </goal>
  -
  -    <goal name="modules:aggregate:geronimo-spec:geronimo-spec-j2ee-deployment">
  -        <!-- Do not do the default libraries stuff -->
  -        <aggregate:default libraries="false"/>
  -
  -        <!-- Put j2ee-deployment into deploy/bootlib -->
  -        <aggregate:copy
  -            source="${module.root}/target"
  -            target="${aggregate.dir}/bootlib"
  -            include="*.jar"/>
  -    </goal>
  -
  -    <goal name="modules:aggregate:geronimo:geronimo-web-console">
  -        <!-- Do not do the default libraries stuff -->
  -        <aggregate:default libraries="false"/>
  -
  -        <!-- Put geronimo-web-console into deploy/jetty/lib -->
  -        <aggregate:copy
  -            source="${module.root}/target"
  -            target="${aggregate.dir}/deploy/jetty"
  -            include="*.war"/>
  -    </goal>
   
   
       <!-- =============================== -->
  @@ -541,114 +458,63 @@
       <!-- Helper to run Apache Geronimo from the current build -->
       <!-- ==================================================== -->
   
  -    <goal name="run">
  -        <j:set var="run.dir" value="${basedir}/target/${release.id}"/>
  -
  -        <j:jelly xmlns="jelly:ant">
  -
  -            <property environment="env"/>
  -            <java classname="org.apache.geronimo.Geronimo"
  -                fork="true"
  -                maxmemory="256m"
  -                failonerror="true"
  -                dir="${run.dir}">
  -
  -                <jvmarg value="-ea"/>
  -
  -                <classpath>
  -                    <pathelement path="${env.JAVA_HOME}/lib/tools.jar"/>
  -                    <pathelement path="${run.dir}/etc"/>
  -                    <fileset dir="${run.dir}/bootlib">
  -                        <include name="*.jar"/>
  -                    </fileset>
  -                    <fileset dir="${run.dir}/lib">
  -                        <include name="*.jar"/>
  -                    </fileset>
  -
  -                    <!-- temporary addition allows RMI to be used, such as with the
JMX RMI connector -->
  -                    <pathelement location="${run.dir}/lib/geronimo-core-rmiclassloaderspi.jar"/>
  -                </classpath>
  -
  -                <sysproperty key="program.name" value="maven:run"/>
  -                <sysproperty key="java.rmi.server.RMIClassLoaderSpi" value="org.apache.geronimo.rmi.RMIClassLoaderSpiImpl"/>
  -
  -                <arg value="org/apache/geronimo/Server"/>
  -                <arg value="${run.dir}/Server.car"/>
  -                <arg value="${run.dir}/lib/geronimo-security-package-DEV.jar,${run.dir}/lib/geronimo-transaction-package-DEV.jar,${run.dir}/lib/geronimo-connector-package-DEV.jar,${run.dir}/lib/geronimo-jetty-package-DEV.jar"/>
  -                <arg value="geronimo"/>
  -                <arg value="${run.dir}/localConfigStore"/>
  -            </java>
  -        </j:jelly>
  +    <goal name="deploy:server">
  +        <j:set var="g.repo" value="${maven.repo.local}/geronimo/jars"/>
  +        <ant:mkdir dir="${basedir}/target"/>
  +        <ant:echo message="in deploy:server"/>
  +        <deploy:deploy
  +            deployconfigid="org/apache/geronimo/Server"
  +            deployoutfile="target/Server.car"
  +            deployurl="${g.repo}/geronimo-security-package-DEV.jar,${g.repo}/geronimo-transaction-package-DEV.jar,${g.repo}/geronimo-connector-package-DEV.jar,${g.repo}/geronimo-jetty-package-DEV.jar"/>
  +        <ant:echo message="did deploy:server"/>
       </goal>
   
  -    <goal name="run:debug">
  -        <j:set var="run.dir" value="${basedir}/target/${release.id}"/>
  -        <j:jelly xmlns="jelly:ant">
  -
  -            <property environment="env"/>
  -            <java classname="org.apache.geronimo.Geronimo"
  -                fork="true"
  -                maxmemory="256m"
  -                failonerror="true"
  -                dir="${run.dir}">
  -
  -                <jvmarg value="-ea"/>
  -
  -                <classpath>
  -                    <pathelement path="${env.JAVA_HOME}/lib/tools.jar"/>
  -                    <pathelement path="${run.dir}/etc"/>
  -                    <fileset dir="${run.dir}/bootlib">
  -                        <include name="*.jar"/>
  -                    </fileset>
  -                    <fileset dir="${run.dir}/lib">
  -                        <include name="*.jar"/>
  -                    </fileset>
  -
  -                    <!-- temporary addition allows RMI to be used, such as with the
JMX RMI connector -->
  -                    <pathelement location="${run.dir}/lib/geronimo-core-rmiclassloaderspi.jar"/>
  -                </classpath>
  -
  -                <jvmarg value="-Xdebug"/>
  -                <jvmarg value="-Xnoagent"/>
  -                <jvmarg value="-Xrunjdwp:transport=dt_socket,address=60000,server=y,suspend=y"/>
  -
  -                <sysproperty key="java.compiler" value="NONE"/>
  -                <sysproperty key="program.name" value="maven:run"/>
  -                <sysproperty key="java.rmi.server.RMIClassLoaderSpi" value="org.apache.geronimo.rmi.RMIClassLoaderSpiImpl"/>
  +    <goal name="install:server">
  +        <ant:echo message="in install:server"/>
  +        <deploy:install
  +            installDomain="geronimo"
  +            installStoreDir="target/localConfigStore"
  +            installConfig="target/Server.car"/>
  +        <ant:echo message="did install:server"/>
  +    </goal>
   
  -                <arg value="org/apache/geronimo/Server"/>
  -                <arg value="${run.dir}/Server.car"/>
  -                <arg value="${run.dir}/lib/geronimo-security-package-DEV.jar,${run.dir}/lib/geronimo-transaction-package-DEV.jar,${run.dir}/lib/geronimo-connector-package-DEV.jar,${run.dir}/lib/geronimo-jetty-package-DEV.jar"/>
  -                <arg value="geronimo"/>
  -                <arg value="${run.dir}/localConfigStore"/>
  -            </java>
  -        </j:jelly>
  +    <goal name="load:server">
  +        <ant:echo message="in load:server"/>
  +        <deploy:loadAndReturn
  +            runDomain="geronimo"
  +            runStoreDir="target/localConfigStore"
  +            runConfigID="org/apache/geronimo/Server"/>
  +        <ant:echo message="did load:server"/>
       </goal>
   
  -    <goal name="run:main">
  -        <ant:echo></ant:echo>
  -        <ant:echo>Please use "maven run" instead</ant:echo>
  -        <ant:echo></ant:echo>
  +    <goal name="loadAndWait:server">
  +        <ant:echo message="in loadAndWait:server"/>
  +        <deploy:loadAndWait
  +            runDomain="geronimo"
  +            runStoreDir="target/localConfigStore"
  +            runConfigID="org/apache/geronimo/Server"/>
  +        <ant:echo message="did loadAndWait:server"/>
       </goal>
   
  -    <goal name="bootstrap:run">
  -        <j:set var="run.dir" value="${basedir}/modules"/>
  +    <goal name="run:server">
  +        <j:set var="run.dir" value="${basedir}"/>
   
           <j:jelly xmlns="jelly:ant">
   
               <property environment="env"/>
  -            <java classname="org.apache.geronimo.deployment.Bootstrap"
  +            <java classname="org.apache.geronimo.Geronimo"
                   fork="true"
                   maxmemory="256m"
                   failonerror="true"
                   dir="${run.dir}">
   
                   <jvmarg value="-ea"/>
  +
                   <classpath>
                       <pathelement path="${env.JAVA_HOME}/lib/tools.jar"/>
                       <!--pathelement path="${run.dir}/etc"/-->
                       <fileset dir="${maven.repo.local}/cglib/jars">
  -                        <include name="cglib-HEAD-20031111.jar"/>
  +                        <include name="cglib-full-2.0-RC2.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/commons-logging/jars">
                           <include name="commons-logging-1.0.3.jar"/>
  @@ -672,79 +538,36 @@
                           <include name="geronimo-kernel-${pom.currentVersion}.jar"/>
                           <include name="geronimo-deployment-${pom.currentVersion}.jar"/>
                           <include name="geronimo-common-${pom.currentVersion}.jar"/>
  -                        <!-- not needed for boot, but I'm not sure how to load otherwise-->
  -                        <include name="geronimo-web-${pom.currentVersion}.jar"/>
  -                        <include name="geronimo-core-${pom.currentVersion}.jar"/>
  -                    </fileset>
  -                    <fileset dir="${maven.repo.local}/geronimo-spec/jars">
  -                        <include name="geronimo-spec-jta-${pom.currentVersion}.jar"/>
  -                        <include name="geronimo-spec-j2ee-connector-${pom.currentVersion}.jar"/>
  -                        <include name="geronimo-spec-j2ee-jacc-${pom.currentVersion}.jar"/>
  -                        <include name="geronimo-spec-jsp-${pom.currentVersion}.jar"/>
  -                        <include name="geronimo-spec-servlet-${pom.currentVersion}.jar"/>
  -                    </fileset>
  -                    <fileset dir="${maven.repo.local}/jetty/jars">
  -                        <include name="jetty-SNAPSHOT.jar"/>
  -                    </fileset>
  -                    <fileset dir="${maven.repo.local}/ant/jars">
  -                        <include name="ant-1.5.2.jar"/>
  -                    </fileset>
  -                    <fileset dir="${maven.repo.local}/tomcat/jars">
  -                        <include name="jasper-compiler-4.0.4.jar"/>
  -                        <include name="jasper-runtime-4.0.4.jar"/>
  -                    </fileset>
  -                    <!-- security -->
  -                    <fileset dir="${maven.repo.local}/regexp/jars">
  -                        <include name="regexp-1.3-dev.jar"/>
  -                    </fileset>
  -                    <!-- connector work manager -->
  -                    <fileset dir="${maven.repo.local}/concurrent/jars">
  -                        <include name="concurrent-1.3.2.jar"/>
  -                    </fileset>
  -                    <!-- connector openjca loading test -->
  -                    <!-- uncomment if you want to load this connector.  Also set the
path in bootstrapped-service.xml-->
  -                    <!--fileset dir="${maven.repo.local}/openejb-jca/jars">
  -                          <include name="openejb-jca-DEV.jar"/>
  -                    </fileset>
  -                    <fileset dir="${maven.repo.local}/hsqldb/jars">
  -                          <include name="hsqldb-1.7.1.jar"/>
  -                    </fileset-->
  -                    <!-- WebDAV, not required for boot. To be fixed.-->
  -                    <fileset dir="${maven.repo.local}/tomcat/jars">
  -                        <include name="catalina-5.0.16.jar"/>
  -                        <include name="catalina-optional-5.0.16.jar"/>
  -                        <include name="naming-common-5.0.16.jar"/>
  -                        <include name="naming-resources-5.0.16.jar"/>
  -                        <include name="servlets-common-5.0.16.jar"/>
  -                        <include name="servlets-default-5.0.16.jar"/>
  -                        <include name="servlets-webdav-5.0.16.jar"/>
  -                        <include name="tomcat-util-5.0.16.jar"/>
                       </fileset>
                   </classpath>
   
  -                <arg value="file:${run.dir}/deployment/src/test-resources/etc/bootstrapped-service.xml"/>
  +                <!--sysproperty key="program.name" value="maven:run"/>
  +                <sysproperty key="java.rmi.server.RMIClassLoaderSpi" value="org.apache.geronimo.rmi.RMIClassLoaderSpiImpl"/-->
   
  +                <arg value="target/localConfigStore"/>
  +                <arg value="org/apache/geronimo/Server"/>
               </java>
           </j:jelly>
       </goal>
   
  -    <goal name="bootstrap:debug">
  -        <j:set var="run.dir" value="${basedir}/modules"/>
  +    <goal name="debug:server">
  +        <j:set var="run.dir" value="${basedir}"/>
           <j:jelly xmlns="jelly:ant">
   
               <property environment="env"/>
  -            <java classname="org.apache.geronimo.deployment.Bootstrap"
  +            <java classname="org.apache.geronimo.Geronimo"
                   fork="true"
                   maxmemory="256m"
                   failonerror="true"
                   dir="${run.dir}">
   
  +                <jvmarg value="-ea"/>
   
                   <classpath>
                       <pathelement path="${env.JAVA_HOME}/lib/tools.jar"/>
                       <!--pathelement path="${run.dir}/etc"/-->
                       <fileset dir="${maven.repo.local}/cglib/jars">
  -                        <include name="cglib-HEAD-20031111.jar"/>
  +                        <include name="cglib-full-2.0-RC2.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/commons-logging/jars">
                           <include name="commons-logging-1.0.3.jar"/>
  @@ -768,67 +591,34 @@
                           <include name="geronimo-kernel-${pom.currentVersion}.jar"/>
                           <include name="geronimo-deployment-${pom.currentVersion}.jar"/>
                           <include name="geronimo-common-${pom.currentVersion}.jar"/>
  -                        <!-- not needed for boot, but I'm not sure how to load otherwise-->
  -                        <include name="geronimo-web-${pom.currentVersion}.jar"/>
  -                        <include name="geronimo-core-${pom.currentVersion}.jar"/>
  -                    </fileset>
  -                    <fileset dir="${maven.repo.local}/geronimo-spec/jars">
  -                        <include name="geronimo-spec-jta-${pom.currentVersion}.jar"/>
  -                        <include name="geronimo-spec-j2ee-connector-${pom.currentVersion}.jar"/>
  -                        <include name="geronimo-spec-j2ee-jacc-${pom.currentVersion}.jar"/>
  -                        <include name="geronimo-spec-jsp-${pom.currentVersion}.jar"/>
  -                        <include name="geronimo-spec-servlet-${pom.currentVersion}.jar"/>
  -                    </fileset>
  -                    <fileset dir="${maven.repo.local}/jetty/jars">
  -                        <include name="jetty-SNAPSHOT.jar"/>
  -                    </fileset>
  -                    <fileset dir="${maven.repo.local}/ant/jars">
  -                        <include name="ant-1.5.2.jar"/>
  -                    </fileset>
  -                    <fileset dir="${maven.repo.local}/tomcat/jars">
  -                        <include name="jasper-compiler-4.0.4.jar"/>
  -                        <include name="jasper-runtime-4.0.4.jar"/>
  -                    </fileset>
  -                    <!-- security -->
  -                    <fileset dir="${maven.repo.local}/regexp/jars">
  -                        <include name="regexp-1.3-dev.jar"/>
  -                    </fileset>
  -                    <!-- connector work manager -->
  -                    <fileset dir="${maven.repo.local}/concurrent/jars">
  -                        <include name="concurrent-1.3.2.jar"/>
  -                    </fileset>
  -                    <!-- connector openjca loading test -->
  -                    <!-- uncomment if you want to load this connector.  Also set the
path in bootstrapped-service.xml-->
  -                    <!--fileset dir="${maven.repo.local}/openejb-jca/jars">
  -                          <include name="openejb-jca-DEV.jar"/>
  -                    </fileset>
  -                    <fileset dir="${maven.repo.local}/hsqldb/jars">
  -                          <include name="hsqldb-1.7.1.jar"/>
  -                    </fileset-->
  -                    <!-- WebDAV, not required for boot. To be fixed.-->
  -                    <fileset dir="${maven.repo.local}/tomcat/jars">
  -                        <include name="catalina-5.0.16.jar"/>
  -                        <include name="catalina-optional-5.0.16.jar"/>
  -                        <include name="naming-common-5.0.16.jar"/>
  -                        <include name="naming-resources-5.0.16.jar"/>
  -                        <include name="servlets-common-5.0.16.jar"/>
  -                        <include name="servlets-default-5.0.16.jar"/>
  -                        <include name="servlets-webdav-5.0.16.jar"/>
  -                        <include name="tomcat-util-5.0.16.jar"/>
                       </fileset>
                   </classpath>
   
  -                <arg value="file:${run.dir}/deployment/src/test-resources/etc/bootstrapped-service.xml"/>
  -
                   <jvmarg value="-Xdebug"/>
                   <jvmarg value="-Xnoagent"/>
  -                <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/>
  +                <jvmarg value="-Xrunjdwp:transport=dt_socket,address=80000,server=y,suspend=y"/>
   
                   <sysproperty key="java.compiler" value="NONE"/>
  -                <sysproperty key="program.name" value="maven:run"/>
  -                <sysproperty key="java.rmi.server.RMIClassLoaderSpi" value="org.apache.geronimo.rmi.RMIClassLoaderSpiImpl"/>
  +                <!--sysproperty key="program.name" value="maven:run"/>
  +                <sysproperty key="java.rmi.server.RMIClassLoaderSpi" value="org.apache.geronimo.rmi.RMIClassLoaderSpiImpl"/-->
  +
  +                <arg value="target/localConfigStore"/>
  +                <arg value="org/apache/geronimo/Server"/>
               </java>
           </j:jelly>
       </goal>
  +
  +    <goal name="deployinstallrun">
  +        <attainGoal name="deploy:server"/>
  +        <attainGoal name="install:server"/>
  +        <attainGoal name="run:server"/>
  +    </goal>
  +
  +    <goal name="run:main">
  +        <ant:echo></ant:echo>
  +        <ant:echo>Please use "maven run:server or maven deployinstallrun" instead</ant:echo>
  +        <ant:echo></ant:echo>
  +    </goal>
  +
   
   </project>
  
  
  
  1.4       +45 -26    incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/Geronimo.java
  
  Index: Geronimo.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/Geronimo.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Geronimo.java	28 Jan 2004 04:27:28 -0000	1.3
  +++ Geronimo.java	28 Jan 2004 23:03:22 -0000	1.4
  @@ -56,14 +56,13 @@
   
   package org.apache.geronimo;
   
  -import org.apache.geronimo.kernel.Kernel;
  -import org.apache.geronimo.kernel.config.LocalConfigStore;
  -
  -import javax.management.ObjectName;
  -import java.io.File;
  -import java.lang.reflect.Method;
   import java.net.URI;
  +import java.net.URISyntaxException;
   import java.net.URL;
  +import java.io.File;
  +
  +import org.apache.geronimo.kernel.config.LocalConfigStore;
  +import org.apache.geronimo.kernel.Kernel;
   
   /**
    *
  @@ -79,34 +78,55 @@
       /**
        * Static entry point allowing a Kernel to be run from the command line.
        * Arguments are:
  -     * <li>the id of a configuation to load</li>
  -     * <li>deploy output file</li>
  -     * <li>deploy urls</li>
  -     * <li>domain</li>
        * <li>the filename of the directory to use for the configuration store.
        *     This will be created if it does not exist.</li>
  +     * <li>the id of a configuation to load</li>
        * Once the Kernel is booted and the configuration is loaded, the process
        * will remain running until the shutdown() method on the kernel is
        * invoked or until the JVM exits.
        * @param args
        */
  -    public static void main(String[] args) throws Exception {
  -        if (args.length < 5) {
  -            System.err.println("usage: " + Geronimo.class.getName() + " <config-id>
<deploy-out-file> <deploy-urls> <domain> <config-store>");
  +    public static void main(String[] args) {
  +        if (args.length < 2) {
  +            System.err.println("usage: " + Geronimo.class.getName() + " <config-store-dir>
<config-id>");
  +            System.exit(1);
  +        }
  +        String storeDirName = args[0];
  +        URI configID = null;
  +        try {
  +            configID = new URI(args[1]);
  +        } catch (URISyntaxException e) {
  +            e.printStackTrace();
               System.exit(1);
           }
  -        String configIDString = args[0];
  -        String outfile = args[1];
  -        String urlsString = args[2];
  -        String domain = args[3];
  -        String storeDirName = args[4];
  -
  -        Class clazz = Class.forName("org.apache.geronimo.deployment.tools.DeployCommand");
  -        Method m = clazz.getMethod("deploy", new Class[]{String.class,String.class,String.class});
  -        m.invoke(null, new Object[]{configIDString, outfile, urlsString});
  +        String domain = "geronimo";
   
  -        installPackage(domain, storeDirName, outfile);
  -        loadAndWait(domain, storeDirName, configIDString);
  +        Kernel kernel = null;
  +        try {
  +            kernel = createKernel(domain, storeDirName);
  +        } catch (IllegalArgumentException e) {
  +            System.err.println(e.getMessage());
  +            System.exit(1);
  +        } catch (Exception e) {
  +            e.printStackTrace();
  +            System.exit(2);
  +        }
  +        try {
  +            kernel.load(configID);
  +        } catch (Exception e) {
  +            kernel.shutdown();
  +            e.printStackTrace();
  +            System.exit(3);
  +        }
  +        while (kernel.isRunning()) {
  +            try {
  +                synchronized (kernel) {
  +                    kernel.wait();
  +                }
  +            } catch (InterruptedException e) {
  +                // continue
  +            }
  +        }
       }
   
       public static Kernel createKernel(String domain, String storeDirName) throws Exception
{
  @@ -149,7 +169,6 @@
   
       public static void loadAndWait(String domain, String storeDirName, String configIDString)
throws Exception {
           Kernel kernel = load(domain, storeDirName, configIDString);
  -        kernel.getMBeanServer().invoke(new ObjectName("geronimo.config:name=" + ObjectName.quote(configIDString)),
"startRecursive", null, null);
           while (kernel.isRunning()) {
               try {
                   synchronized (kernel) {
  
  
  

Mime
View raw message