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/maven-plugin plugin.jelly
Date Mon, 26 Jan 2004 18:02:15 GMT
djencks     2004/01/26 10:02:15

  Modified:    .        maven.xml
               modules/kernel/src/java/org/apache/geronimo/kernel
                        Kernel.java
               modules/maven-plugin plugin.jelly
  Added:       modules/kernel/src/java/org/apache/geronimo Geronimo.java
  Log:
  Separate static methods from Kernel: provide deploy, install, and load/run functionality
from maven-plugin
  
  Revision  Changes    Path
  1.1                  incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/Geronimo.java
  
  Index: Geronimo.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Geronimo" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Geronimo", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * ====================================================================
   */
  
  package org.apache.geronimo;
  
  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;
  
  /**
   *
   *
   * @version $Revision: 1.1 $ $Date: 2004/01/26 18:02:15 $
   *
   * */
  public class Geronimo {
  
      private Geronimo() {
  
       }
      /**
       * Static entry point allowing a Kernel to be run from the command line.
       * Arguments are:
       * <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) {
          if (args.length < 2) {
              System.err.println("usage: " + Kernel.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 domain = "geronimo";
  
          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(2);
          }
          while (kernel.isRunning()) {
              try {
                  synchronized (kernel) {
                      kernel.wait();
                  }
              } catch (InterruptedException e) {
                  // continue
              }
          }
      }
  
      public static Kernel createKernel(String domain, String storeDirName) throws Exception
{
          File storeDir = new File(storeDirName);
          if (storeDir.exists()) {
              if (!storeDir.isDirectory() || !storeDir.canWrite()) {
                  throw new IllegalArgumentException("Store location is not a writable directory:
" + storeDir);
              }
          } else {
              if (!storeDir.mkdirs()) {
                  throw new IllegalArgumentException("Could not create store directory: "
+ storeDir);
              }
          }
  
          final Kernel kernel = new Kernel(domain, LocalConfigStore.GBEAN_INFO, storeDir);
          Runtime.getRuntime().addShutdownHook(new Thread("Shutdown Thread") {
              public void run() {
                  kernel.shutdown();
              }
          });
          //Kernel may not be loaded by SystemClassLoader if run embedded.
          Thread.currentThread().setContextClassLoader(kernel.getClass().getClassLoader());
          kernel.boot();
          return kernel;
      }
  
      public static Kernel installPackage(String domain, String storeDirName, String packageURLName)
throws Exception {
          Kernel kernel = createKernel(domain, storeDirName);
          URL packageURL = new File(packageURLName).toURL();
          kernel.install(packageURL);
          return kernel;
      }
  
      public static Kernel load(String domain, String storeDirName, String configIDString)
throws Exception {
          Kernel kernel = createKernel(domain, storeDirName);
          URI configID = new URI(configIDString);
          kernel.load(configID);
          return kernel;
      }
  
      public static void loadAndWait(String domain, String storeDirName, String configIDString)
throws Exception {
          Kernel kernel = load(domain, storeDirName, configIDString);
          while (kernel.isRunning()) {
              try {
                  synchronized (kernel) {
                      kernel.wait();
                  }
              } catch (InterruptedException e) {
                  // continue
              }
          }
      }
  }
  
  
  
  1.58      +115 -88   incubator-geronimo/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/maven.xml,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- maven.xml	25 Jan 2004 17:55:32 -0000	1.57
  +++ maven.xml	26 Jan 2004 18:02:15 -0000	1.58
  @@ -21,7 +21,34 @@
               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:test"/>
  +        <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 -->
  @@ -520,59 +547,59 @@
           <!--
              | Should really execute the system script but for now...
            -->
  -<!--        <j:set var="run.dir" value="${basedir}/target/${release.id}"/>-->
  -<!--        <j:jelly xmlns="jelly:ant">-->
  -<!--            <java-->
  -<!--                classname="org.codehaus.classworlds.Launcher"-->
  -<!--                fork="true"-->
  -<!--                maxmemory="128m"-->
  -<!--                failonerror="true"-->
  -<!--                dir="${run.dir}">-->
  -<!---->
  -<!--                <classpath>-->
  -<!--                    <pathelement location="${run.dir}/lib/classworlds-SNAPSHOT.jar"/>-->
  -<!--                    <pathelement location="${run.dir}/lib/geronimo-core-rmiclassloaderspi.jar"/>-->
  -<!--                </classpath>-->
  -<!---->
  -<!--                <sysproperty key="classworlds.conf" value="${run.dir}/etc/classworlds.conf"/>-->
  -<!--                <sysproperty key="program.name" value="maven:run"/>-->
  -<!--                <sysproperty key="twiddle.home" value="${run.dir}"/>-->
  -<!--                <sysproperty key="java.rmi.server.RMIClassLoaderSpi" value="org.apache.geronimo.rmi.RMIClassLoaderSpiImpl"/>-->
  -<!--                <arg value="geronimo/start"/>-->
  -<!--            </java>-->
  -<!--        </j:jelly>-->
  +        <!--        <j:set var="run.dir" value="${basedir}/target/${release.id}"/>-->
  +        <!--        <j:jelly xmlns="jelly:ant">-->
  +        <!--            <java-->
  +        <!--                classname="org.codehaus.classworlds.Launcher"-->
  +        <!--                fork="true"-->
  +        <!--                maxmemory="128m"-->
  +        <!--                failonerror="true"-->
  +        <!--                dir="${run.dir}">-->
  +        <!---->
  +        <!--                <classpath>-->
  +        <!--                    <pathelement location="${run.dir}/lib/classworlds-SNAPSHOT.jar"/>-->
  +        <!--                    <pathelement location="${run.dir}/lib/geronimo-core-rmiclassloaderspi.jar"/>-->
  +        <!--                </classpath>-->
  +        <!---->
  +        <!--                <sysproperty key="classworlds.conf" value="${run.dir}/etc/classworlds.conf"/>-->
  +        <!--                <sysproperty key="program.name" value="maven:run"/>-->
  +        <!--                <sysproperty key="twiddle.home" value="${run.dir}"/>-->
  +        <!--                <sysproperty key="java.rmi.server.RMIClassLoaderSpi"
value="org.apache.geronimo.rmi.RMIClassLoaderSpiImpl"/>-->
  +        <!--                <arg value="geronimo/start"/>-->
  +        <!--            </java>-->
  +        <!--        </j:jelly>-->
       </goal>
   
       <goal name="run:main">
           <ant:echo>Run targets are currently disabled.  Please, check out the last
working revision last_geronimombean.</ant:echo>
   
  -<!--        <j:set var="run.dir" value="${basedir}/target/${release.id}"/>-->
  -<!---->
  -<!--        <j:jelly xmlns="jelly:ant">-->
  -<!---->
  -<!--            <property environment="env"/>-->
  -<!--            <java classname="org.apache.geronimo.kernel.Main"-->
  -<!--                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>-->
  -<!---->
  -                    <!-- 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"/>-->
  -<!--            </java>-->
  -<!--        </j:jelly>-->
  +        <!--        <j:set var="run.dir" value="${basedir}/target/${release.id}"/>-->
  +        <!---->
  +        <!--        <j:jelly xmlns="jelly:ant">-->
  +        <!---->
  +        <!--            <property environment="env"/>-->
  +        <!--            <java classname="org.apache.geronimo.kernel.Main"-->
  +        <!--                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>-->
  +        <!---->
  +        <!-- 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"/>-->
  +        <!--            </java>-->
  +        <!--        </j:jelly>-->
       </goal>
   
       <goal name="debug:main">
  @@ -626,25 +653,25 @@
                       <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-HEAD-20031111.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/commons-logging/jars">
  -                          <include name="commons-logging-1.0.3.jar"/>
  +                        <include name="commons-logging-1.0.3.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/log4j/jars">
  -                          <include name="log4j-1.2.8.jar"/>
  +                        <include name="log4j-1.2.8.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/mx4j/jars">
  -                          <include name="mx4j-SNAPSHOT.jar"/>
  +                        <include name="mx4j-SNAPSHOT.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/xerces/jars">
  -                          <include name="xercesImpl-2.6.0.jar"/>
  +                        <include name="xercesImpl-2.6.0.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/xml-apis/jars">
  -                          <include name="xml-apis-1.0.b2.jar"/>
  +                        <include name="xml-apis-1.0.b2.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/xml-commons-resolver/jars">
  -                          <include name="xml-commons-resolver-1.1.jar"/>
  +                        <include name="xml-commons-resolver-1.1.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/geronimo/jars">
                           <include name="geronimo-kernel-${pom.currentVersion}.jar"/>
  @@ -662,10 +689,10 @@
                           <include name="geronimo-spec-servlet-${pom.currentVersion}.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/jetty/jars">
  -                          <include name="jetty-SNAPSHOT.jar"/>
  +                        <include name="jetty-SNAPSHOT.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/ant/jars">
  -                          <include name="ant-1.5.2.jar"/>
  +                        <include name="ant-1.5.2.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/tomcat/jars">
                           <include name="jasper-compiler-4.0.4.jar"/>
  @@ -673,11 +700,11 @@
                       </fileset>
                       <!-- security -->
                       <fileset dir="${maven.repo.local}/regexp/jars">
  -                          <include name="regexp-1.3-dev.jar"/>
  +                        <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"/>
  +                        <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-->
  @@ -689,14 +716,14 @@
                       </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"/>
  +                        <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>
   
  @@ -722,25 +749,25 @@
                       <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-HEAD-20031111.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/commons-logging/jars">
  -                          <include name="commons-logging-1.0.3.jar"/>
  +                        <include name="commons-logging-1.0.3.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/log4j/jars">
  -                          <include name="log4j-1.2.8.jar"/>
  +                        <include name="log4j-1.2.8.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/mx4j/jars">
  -                          <include name="mx4j-SNAPSHOT.jar"/>
  +                        <include name="mx4j-SNAPSHOT.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/xerces/jars">
  -                          <include name="xercesImpl-2.6.0.jar"/>
  +                        <include name="xercesImpl-2.6.0.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/xml-apis/jars">
  -                          <include name="xml-apis-1.0.b2.jar"/>
  +                        <include name="xml-apis-1.0.b2.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/xml-commons-resolver/jars">
  -                          <include name="xml-commons-resolver-1.1.jar"/>
  +                        <include name="xml-commons-resolver-1.1.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/geronimo/jars">
                           <include name="geronimo-kernel-${pom.currentVersion}.jar"/>
  @@ -758,10 +785,10 @@
                           <include name="geronimo-spec-servlet-${pom.currentVersion}.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/jetty/jars">
  -                          <include name="jetty-SNAPSHOT.jar"/>
  +                        <include name="jetty-SNAPSHOT.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/ant/jars">
  -                          <include name="ant-1.5.2.jar"/>
  +                        <include name="ant-1.5.2.jar"/>
                       </fileset>
                       <fileset dir="${maven.repo.local}/tomcat/jars">
                           <include name="jasper-compiler-4.0.4.jar"/>
  @@ -769,11 +796,11 @@
                       </fileset>
                       <!-- security -->
                       <fileset dir="${maven.repo.local}/regexp/jars">
  -                          <include name="regexp-1.3-dev.jar"/>
  +                        <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"/>
  +                        <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-->
  @@ -785,14 +812,14 @@
                       </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"/>
  +                        <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>
   
  
  
  
  1.12      +2 -69     incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java
  
  Index: Kernel.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Kernel.java	26 Jan 2004 05:55:27 -0000	1.11
  +++ Kernel.java	26 Jan 2004 18:02:15 -0000	1.12
  @@ -419,74 +419,7 @@
           return running;
       }
   
  -    /**
  -     * Static entry point allowing a Kernel to be run from the command line.
  -     * Arguments are:
  -     * <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) {
  -        if (args.length < 2) {
  -            System.err.println("usage: " + Kernel.class.getName() + " <config-store-dir>
<config-id>");
  -            System.exit(1);
  -        }
  -        File storeDir = new File(args[0]);
  -        URI configID = null;
  -        try {
  -            configID = new URI(args[1]);
  -        } catch (URISyntaxException e) {
  -            e.printStackTrace();
  -            System.exit(1);
  -        }
  -
  -        String domain = "geronimo";
  -        if (storeDir.exists()) {
  -            if (!storeDir.isDirectory() || !storeDir.canWrite()) {
  -                System.err.println("Store location is not a writable directory: " + storeDir);
  -                System.exit(1);
  -            }
  -        } else {
  -            if (!storeDir.mkdirs()) {
  -                System.err.println("Could not create store directory: " + storeDir);
  -                System.exit(1);
  -            }
  -        }
  -
  -        final Kernel kernel = new Kernel(domain, LocalConfigStore.GBEAN_INFO, storeDir);
  -        Runtime.getRuntime().addShutdownHook(new Thread("Shutdown Thread") {
  -            public void run() {
  -                kernel.shutdown();
  -            }
  -        });
  -        try {
  -            kernel.boot();
  -        } catch (Exception e) {
  -            e.printStackTrace();
  -            System.exit(2);
  -        }
  -        try {
  -            kernel.load(configID);
  -        } catch (Exception e) {
  -            kernel.shutdown();
  -            e.printStackTrace();
  -            System.exit(2);
  -        }
  -        while (kernel.isRunning()) {
  -            try {
  -                synchronized (kernel) {
  -                    kernel.wait();
  -                }
  -            } catch (InterruptedException e) {
  -                // continue
  -            }
  -        }
  -    }
  -
  +    //NotificationBroadcaster support so Kernel can be an endpoint.
       public MBeanNotificationInfo[] getNotificationInfo() {
           return new MBeanNotificationInfo[0];
       }
  
  
  
  1.2       +52 -0     incubator-geronimo/modules/maven-plugin/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/maven-plugin/plugin.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- plugin.jelly	24 Jan 2004 19:50:04 -0000	1.1
  +++ plugin.jelly	26 Jan 2004 18:02:15 -0000	1.2
  @@ -30,6 +30,58 @@
                   <j:arg type="java.lang.String" value="${deployurl}"/>
               </j:invokeStatic>
           </define:tag>
  +
  +        <define:tag name="install" xmlns="jelly:ant">
  +            <j:if test="${installDomain == null}">
  +                <fail>Missing required attribute: installDomain</fail>
  +            </j:if>
  +            <j:if test="${installStoreDir == null}">
  +                <fail>Missing required attribute: installStoreDir</fail>
  +            </j:if>
  +            <j:if test="${installConfig == null}">
  +                <fail>Missing required attribute: installConfig</fail>
  +            </j:if>
  +            <j:invokeStatic var="kernel" className="org.apache.geronimo.Geronimo" method="installPackage">
  +                <j:arg type="java.lang.String" value="${installDomain}"/>
  +                <j:arg type="java.lang.String" value="${installStoreDir}"/>
  +                <j:arg type="java.lang.String" value="${installConfig}"/>
  +            </j:invokeStatic>
  +        </define:tag>
  +
  +        <define:tag name="loadAndReturn" xmlns="jelly:ant">
  +            <j:if test="${runDomain == null}">
  +                <fail>Missing required attribute: runDomain</fail>
  +            </j:if>
  +            <j:if test="${runStoreDir == null}">
  +                <fail>Missing required attribute: runStoreDir</fail>
  +            </j:if>
  +            <j:if test="${runConfigID == null}">
  +                <fail>Missing required attribute: runConfigID</fail>
  +            </j:if>
  +            <j:invokeStatic var="kernel" className="org.apache.geronimo.Geronimo" method="load">
  +                <j:arg type="java.lang.String" value="${runDomain}"/>
  +                <j:arg type="java.lang.String" value="${runStoreDir}"/>
  +                <j:arg type="java.lang.String" value="${runConfigID}"/>
  +            </j:invokeStatic>
  +        </define:tag>
  +
  +        <define:tag name="loadAndWait" xmlns="jelly:ant">
  +            <j:if test="${runDomain == null}">
  +                <fail>Missing required attribute: runDomain</fail>
  +            </j:if>
  +            <j:if test="${runStoreDir == null}">
  +                <fail>Missing required attribute: runStoreDir</fail>
  +            </j:if>
  +            <j:if test="${runConfigID == null}">
  +                <fail>Missing required attribute: runConfigID</fail>
  +            </j:if>
  +            <j:invokeStatic var="kernel" className="org.apache.geronimo.Geronimo" method="loadAndWait">
  +                <j:arg type="java.lang.String" value="${runDomain}"/>
  +                <j:arg type="java.lang.String" value="${runStoreDir}"/>
  +                <j:arg type="java.lang.String" value="${runConfigID}"/>
  +            </j:invokeStatic>
  +        </define:tag>
  +
       </define:taglib>
   
   </project>
  
  
  

Mime
View raw message