geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject svn commit: r519569 - in /geronimo/server/trunk: assemblies/geronimo-boilerplate-minimal/ configs/client-system/ configs/client-system/src/plan/ configs/geronimo-gbean-deployer/ configs/j2ee-system/ configs/j2ee-system/src/plan/ configs/online-deployer...
Date Sun, 18 Mar 2007 07:32:37 GMT
Author: gdamour
Date: Sun Mar 18 00:32:35 2007
New Revision: 519569

URL: http://svn.apache.org/viewvc?view=rev&rev=519569
Log:
Apply MainBootstrapper boot approach to ClientCommandLine and Daemon to
reduce reliance on lib/ and uniform the way the CLI work.

This fixes GERONIMO-2978 - ClientCommandLine and Daemon improvement to reduce 
reliance on lib/.

As part of this change, the RMIClassLoaderSpi implementation has been moved
from geronimo-system to geronimo-kernel as such an implementation must be
in the system class loader and geronimo-system is no longer imported by
the system class loader.

Added:
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/rmi/
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/rmi/RMIClassLoaderSpiImpl.java
      - copied, changed from r519183, geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/rmi/RMIClassLoaderSpiImpl.java
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/rmi/RMIRegistryService.java
      - copied, changed from r519183, geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/rmi/RMIRegistryService.java
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/MainConfigurationBootstrapper.java
    geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/rmi/
    geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/rmi/RMIClassLoaderSpiImplTest.java
      - copied, changed from r519183, geronimo/server/trunk/modules/geronimo-system/src/test/java/org/apache/geronimo/system/rmi/RMIClassLoaderSpiImplTest.java
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedClientCommandLine.java
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java
Removed:
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/rmi/
    geronimo/server/trunk/modules/geronimo-system/src/test/java/org/apache/geronimo/system/rmi/
Modified:
    geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/pom.xml
    geronimo/server/trunk/configs/client-system/pom.xml
    geronimo/server/trunk/configs/client-system/src/plan/plan.xml
    geronimo/server/trunk/configs/geronimo-gbean-deployer/pom.xml
    geronimo/server/trunk/configs/j2ee-system/pom.xml
    geronimo/server/trunk/configs/j2ee-system/src/plan/plan.xml
    geronimo/server/trunk/configs/online-deployer/pom.xml
    geronimo/server/trunk/configs/rmi-naming/src/plan/plan.xml
    geronimo/server/trunk/modules/geronimo-kernel/pom.xml
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/MainBootstrapper.java
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ClientCommandLine.java
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/CommandLine.java
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/Daemon.java

Modified: geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/pom.xml?view=diff&rev=519569&r1=519568&r2=519569
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/pom.xml (original)
+++ geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/pom.xml Sun Mar 18 00:32:35 2007
@@ -78,31 +78,8 @@
                                     <artifactId>xstream</artifactId>
                                 </artifactItem>
                                 <artifactItem>
-                                    <groupId>commons-jexl</groupId>
-                                    <artifactId>commons-jexl</artifactId>
-                                </artifactItem>
-                                <artifactItem>
-                                    <groupId>ognl</groupId>
-                                    <artifactId>ognl</artifactId>
-                                </artifactItem>
-                                <artifactItem>
-                                    <groupId>org.apache.geronimo.modules</groupId>
-                                    <artifactId>geronimo-common</artifactId>
-                                    <version>${version}</version>
-                                </artifactItem>
-                                <artifactItem>
                                     <groupId>org.apache.geronimo.modules</groupId>
                                     <artifactId>geronimo-kernel</artifactId>
-                                    <version>${version}</version>
-                                </artifactItem>
-                                <artifactItem>
-                                    <groupId>org.apache.geronimo.modules</groupId>
-                                    <artifactId>geronimo-util</artifactId>
-                                    <version>${version}</version>
-                                </artifactItem>
-                                <artifactItem>
-                                    <groupId>org.apache.geronimo.modules</groupId>
-                                    <artifactId>geronimo-system</artifactId>
                                     <version>${version}</version>
                                 </artifactItem>
                                 <artifactItem>

Modified: geronimo/server/trunk/configs/client-system/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/client-system/pom.xml?view=diff&rev=519569&r1=519568&r2=519569
==============================================================================
--- geronimo/server/trunk/configs/client-system/pom.xml (original)
+++ geronimo/server/trunk/configs/client-system/pom.xml Sun Mar 18 00:32:35 2007
@@ -37,20 +37,47 @@
 
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-common</artifactId>
+            <version>${version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-system</artifactId>
             <version>${version}</version>
         </dependency>
 
         <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-util</artifactId>
+            <version>${version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-cli</groupId>
+            <artifactId>commons-cli</artifactId>
         </dependency>
 
         <dependency>
+            <groupId>jline</groupId>
+            <artifactId>jline</artifactId>
+        </dependency>
+        
+        <dependency>
             <groupId>commons-jexl</groupId>
             <artifactId>commons-jexl</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>ognl</groupId>
+            <artifactId>ognl</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
+        </dependency>
+
     </dependencies>
 
     <build>
@@ -65,7 +92,7 @@
                             <Extension-Dirs>lib/ext</Extension-Dirs>
                         </manifestEntries>
                         <manifest>
-                            <mainClass>org.apache.geronimo.system.main.ClientCommandLine</mainClass>
+                            <mainClass>org.apache.geronimo.kernel.util.MainConfigurationBootstrapper</mainClass>
                         </manifest>
                     </archive>
                     
@@ -75,33 +102,15 @@
                     <classpath>
                         <element>
                             <groupId>org.apache.geronimo.modules</groupId>
-                            <artifactId>geronimo-common</artifactId>
-                            <version>${version}</version>
-                        </element>
-                        <element>
-                            <groupId>org.apache.geronimo.modules</groupId>
                             <artifactId>geronimo-kernel</artifactId>
                             <version>${version}</version>
                         </element>
                         <element>
                             <groupId>org.apache.geronimo.modules</groupId>
-                            <artifactId>geronimo-system</artifactId>
-                            <version>${version}</version>
-                        </element>
-                        <element>
-                            <groupId>org.apache.geronimo.modules</groupId>
                             <artifactId>geronimo-util</artifactId>
                             <version>${version}</version>
                         </element>
                         <element>
-                            <groupId>backport-util-concurrent</groupId>
-                            <artifactId>backport-util-concurrent</artifactId>
-                        </element>
-                        <element>
-                            <groupId>commons-cli</groupId>
-                            <artifactId>commons-cli</artifactId>
-                        </element>
-                        <element>
                             <groupId>commons-logging</groupId>
                             <artifactId>commons-logging</artifactId>
                         </element>
@@ -114,20 +123,12 @@
                             <artifactId>log4j</artifactId>
                         </element>
                         <element>
-                            <groupId>jline</groupId>
-                            <artifactId>jline</artifactId>
-                        </element>
-                        <element>
                             <groupId>xpp3</groupId>
                             <artifactId>xpp3</artifactId>
                         </element>
                         <element>
                             <groupId>xstream</groupId>
                             <artifactId>xstream</artifactId>
-                        </element>
-                        <element>
-                            <groupId>commons-jexl</groupId>
-                            <artifactId>commons-jexl</artifactId>
                         </element>
                     </classpath>
                     <classpathPrefix>../lib</classpathPrefix>

Modified: geronimo/server/trunk/configs/client-system/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/client-system/src/plan/plan.xml?view=diff&rev=519569&r1=519568&r2=519569
==============================================================================
--- geronimo/server/trunk/configs/client-system/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/client-system/src/plan/plan.xml Sun Mar 18 00:32:35 2007
@@ -18,6 +18,8 @@
 
 <module xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
 
+    <gbean name="EmbeddedClientCommandLine" class="org.apache.geronimo.system.main.EmbeddedClientCommandLine"/>
+
     <!-- ServerInfo service -->
     <gbean name="ServerInfo" class="org.apache.geronimo.system.serverinfo.BasicServerInfo"/>
 

Modified: geronimo/server/trunk/configs/geronimo-gbean-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/geronimo-gbean-deployer/pom.xml?view=diff&rev=519569&r1=519568&r2=519569
==============================================================================
--- geronimo/server/trunk/configs/geronimo-gbean-deployer/pom.xml (original)
+++ geronimo/server/trunk/configs/geronimo-gbean-deployer/pom.xml Sun Mar 18 00:32:35 2007
@@ -34,6 +34,12 @@
     <packaging>car</packaging>
     
     <dependencies>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-common</artifactId>
+            <version>${version}</version>
+        </dependency>
         
         <!-- needed by the plan -->
         <dependency>

Modified: geronimo/server/trunk/configs/j2ee-system/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/j2ee-system/pom.xml?view=diff&rev=519569&r1=519568&r2=519569
==============================================================================
--- geronimo/server/trunk/configs/j2ee-system/pom.xml (original)
+++ geronimo/server/trunk/configs/j2ee-system/pom.xml Sun Mar 18 00:32:35 2007
@@ -42,13 +42,45 @@
             <type>car</type>
             <scope>test</scope>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-common</artifactId>
+            <version>${version}</version>
+        </dependency>
         
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-system</artifactId>
             <version>${version}</version>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-util</artifactId>
+            <version>${version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-cli</groupId>
+            <artifactId>commons-cli</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>jline</groupId>
+            <artifactId>jline</artifactId>
+        </dependency>
         
+        <dependency>
+            <groupId>commons-jexl</groupId>
+            <artifactId>commons-jexl</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>ognl</groupId>
+            <artifactId>ognl</artifactId>
+        </dependency>
+
     </dependencies>
     
     <build>
@@ -63,7 +95,7 @@
                             <Extension-Dirs>lib/ext</Extension-Dirs>
                         </manifestEntries>
                         <manifest>
-                            <mainClass>org.apache.geronimo.system.main.Daemon</mainClass>
+                            <mainClass>org.apache.geronimo.kernel.util.MainConfigurationBootstrapper</mainClass>
                         </manifest>
                     </archive>
                     
@@ -73,27 +105,12 @@
                     <classpath>
                         <element>
                             <groupId>org.apache.geronimo.modules</groupId>
-                            <artifactId>geronimo-common</artifactId>
-                            <version>${version}</version>
-                        </element>
-                        <element>
-                            <groupId>org.apache.geronimo.modules</groupId>
                             <artifactId>geronimo-kernel</artifactId>
                             <version>${version}</version>
                         </element>
                         <element>
-                            <groupId>org.apache.geronimo.modules</groupId>
-                            <artifactId>geronimo-system</artifactId>
-                            <version>${version}</version>
-                        </element>
-                        <element>
-                            <groupId>org.apache.geronimo.modules</groupId>
-                            <artifactId>geronimo-util</artifactId>
-                            <version>${version}</version>
-                        </element>
-                        <element>
-                            <groupId>commons-cli</groupId>
-                            <artifactId>commons-cli</artifactId>
+                            <groupId>backport-util-concurrent</groupId>
+                            <artifactId>backport-util-concurrent</artifactId>
                         </element>
                         <element>
                             <groupId>commons-logging</groupId>
@@ -108,28 +125,12 @@
                             <artifactId>log4j</artifactId>
                         </element>
                         <element>
-                            <groupId>jline</groupId>
-                            <artifactId>jline</artifactId>
-                        </element>
-                        <element>
                             <groupId>xpp3</groupId>
                             <artifactId>xpp3</artifactId>
                         </element>
                         <element>
                             <groupId>xstream</groupId>
                             <artifactId>xstream</artifactId>
-                        </element>
-                        <element>
-                            <groupId>commons-jexl</groupId>
-                            <artifactId>commons-jexl</artifactId>
-                        </element>
-                        <element>
-                            <groupId>ognl</groupId>
-                            <artifactId>ognl</artifactId>
-                        </element>
-                        <element>
-                            <groupId>backport-util-concurrent</groupId>
-                            <artifactId>backport-util-concurrent</artifactId>
                         </element>
                     </classpath>
                     <classpathPrefix>../lib</classpathPrefix>

Modified: geronimo/server/trunk/configs/j2ee-system/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/j2ee-system/src/plan/plan.xml?view=diff&rev=519569&r1=519568&r2=519569
==============================================================================
--- geronimo/server/trunk/configs/j2ee-system/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/j2ee-system/src/plan/plan.xml Sun Mar 18 00:32:35 2007
@@ -28,6 +28,8 @@
 
 <module xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
 
+    <gbean name="EmbeddedDaemon" class="org.apache.geronimo.system.main.EmbeddedDaemon"/>
+
     <!-- ServerInfo service -->
     <gbean name="ServerInfo" class="org.apache.geronimo.system.serverinfo.BasicServerInfo"/>
 

Modified: geronimo/server/trunk/configs/online-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/online-deployer/pom.xml?view=diff&rev=519569&r1=519568&r2=519569
==============================================================================
--- geronimo/server/trunk/configs/online-deployer/pom.xml (original)
+++ geronimo/server/trunk/configs/online-deployer/pom.xml Sun Mar 18 00:32:35 2007
@@ -33,6 +33,48 @@
     <name>Geronimo Configs :: Online Deployer</name>
     <packaging>car</packaging>
 
+    <dependencies>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-common</artifactId>
+            <version>${version}</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-system</artifactId>
+            <version>${version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-util</artifactId>
+            <version>${version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-cli</groupId>
+            <artifactId>commons-cli</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>jline</groupId>
+            <artifactId>jline</artifactId>
+        </dependency>
+        
+        <dependency>
+            <groupId>commons-jexl</groupId>
+            <artifactId>commons-jexl</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>ognl</groupId>
+            <artifactId>ognl</artifactId>
+        </dependency>
+
+    </dependencies>
+
     <build>
         <plugins>
             <plugin>
@@ -59,6 +101,10 @@
                             <version>${version}</version>
                         </element>
                         <element>
+                            <groupId>backport-util-concurrent</groupId>
+                            <artifactId>backport-util-concurrent</artifactId>
+                        </element>
+                        <element>
                             <groupId>commons-logging</groupId>
                             <artifactId>commons-logging</artifactId>
                         </element>
@@ -77,10 +123,6 @@
                         <element>
                             <groupId>xstream</groupId>
                             <artifactId>xstream</artifactId>
-                        </element>
-                        <element>
-                            <!-- IMPORTANT: server.jar is required for offline deployer to work -->
-                            <entry>server.jar</entry>
                         </element>
                     </classpath>
                     <classpathPrefix>../lib</classpathPrefix>

Modified: geronimo/server/trunk/configs/rmi-naming/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/rmi-naming/src/plan/plan.xml?view=diff&rev=519569&r1=519568&r2=519569
==============================================================================
--- geronimo/server/trunk/configs/rmi-naming/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/rmi-naming/src/plan/plan.xml Sun Mar 18 00:32:35 2007
@@ -20,7 +20,7 @@
 
 <module xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
 
-    <gbean name="RMIRegistry" class="org.apache.geronimo.system.rmi.RMIRegistryService">
+    <gbean name="RMIRegistry" class="org.apache.geronimo.kernel.rmi.RMIRegistryService">
         <attribute name="port">${PlanNamingPort}</attribute>
     </gbean>
 

Modified: geronimo/server/trunk/modules/geronimo-kernel/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/pom.xml?view=diff&rev=519569&r1=519568&r2=519569
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-kernel/pom.xml Sun Mar 18 00:32:35 2007
@@ -58,6 +58,11 @@
             <groupId>xpp3</groupId>
             <artifactId>xpp3</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>backport-util-concurrent</groupId>
+            <artifactId>backport-util-concurrent</artifactId>
+        </dependency>
         
     </dependencies>
 

Copied: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/rmi/RMIClassLoaderSpiImpl.java (from r519183, geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/rmi/RMIClassLoaderSpiImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/rmi/RMIClassLoaderSpiImpl.java?view=diff&rev=519569&p1=geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/rmi/RMIClassLoaderSpiImpl.java&r1=519183&p2=geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/rmi/RMIClassLoaderSpiImpl.java&r2=519569
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/rmi/RMIClassLoaderSpiImpl.java (original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/rmi/RMIClassLoaderSpiImpl.java Sun Mar 18 00:32:35 2007
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.geronimo.system.rmi;
+package org.apache.geronimo.kernel.rmi;
 
 import java.net.MalformedURLException;
 import java.net.URL;

Copied: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/rmi/RMIRegistryService.java (from r519183, geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/rmi/RMIRegistryService.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/rmi/RMIRegistryService.java?view=diff&rev=519569&p1=geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/rmi/RMIRegistryService.java&r1=519183&p2=geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/rmi/RMIRegistryService.java&r2=519569
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/rmi/RMIRegistryService.java (original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/rmi/RMIRegistryService.java Sun Mar 18 00:32:35 2007
@@ -14,7 +14,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.geronimo.system.rmi;
+package org.apache.geronimo.kernel.rmi;
 
 import java.rmi.registry.LocateRegistry;
 import java.rmi.registry.Registry;

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/MainBootstrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/MainBootstrapper.java?view=diff&rev=519569&r1=519568&r2=519569
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/MainBootstrapper.java (original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/MainBootstrapper.java Sun Mar 18 00:32:35 2007
@@ -16,8 +16,6 @@
  */
 package org.apache.geronimo.kernel.util;
 
-import java.io.IOException;
-import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -25,8 +23,6 @@
 
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.config.PersistentConfigurationList;
@@ -36,72 +32,10 @@
  *
  * @version $Rev: 476049 $ $Date: 2006-11-17 15:35:17 +1100 (Fri, 17 Nov 2006) $
  */
-public class MainBootstrapper {
+public class MainBootstrapper extends MainConfigurationBootstrapper {
 
     public static void main(String[] args) {
-        MainBootstrapper bootstrapper = new MainBootstrapper();
-        Main main = bootstrapper.getMain(MainBootstrapper.class.getClassLoader());
-
-        int exitCode;
-        ClassLoader oldTCCL = Thread.currentThread().getContextClassLoader();
-        try {
-            ClassLoader newTCCL = main.getClass().getClassLoader();
-            Thread.currentThread().setContextClassLoader(newTCCL);
-            exitCode = main.execute(args);
-        } finally {
-            Thread.currentThread().setContextClassLoader(oldTCCL);
-        }
-        bootstrapper.shutdown();
-        
-        System.exit(exitCode);
-    }
-    
-    protected Kernel kernel;
-    
-    public Main getMain(ClassLoader classLoader) {
-        try {
-            bootKernel();
-            loadBootConfiguration(classLoader);
-            loadPersistentConfigurations();
-            return getMain();
-        } catch (Exception e) {
-            if (null != kernel) {
-                kernel.shutdown();
-            }
-            e.printStackTrace();
-            System.exit(1);
-            throw new AssertionError();
-        }
-    }
-    
-    public void shutdown() {
-        kernel.shutdown();
-    }
-
-    public void bootKernel() throws Exception {
-        kernel = KernelFactory.newInstance().createKernel("MainBootstrapper");
-        kernel.boot();
-
-        Runtime.getRuntime().addShutdownHook(new Thread("MainBootstrapper shutdown thread") {
-            public void run() {
-                kernel.shutdown();
-            }
-        });
-    }
-    
-    public void loadBootConfiguration(ClassLoader classLoader) throws Exception {
-        InputStream in = classLoader.getResourceAsStream("META-INF/config.ser");
-        try {
-            ConfigurationUtil.loadBootstrapConfiguration(kernel, in, classLoader, true);
-        } finally {
-            if (in != null) {
-                try {
-                    in.close();
-                } catch (IOException ignored) {
-                    // ignored
-                }
-            }
-        }
+        main(new MainBootstrapper(), args);
     }
     
     public void loadPersistentConfigurations() throws Exception {
@@ -125,12 +59,4 @@
         }
     }
 
-    public Main getMain() throws Exception {
-        return (Main) kernel.getGBean(Main.class);
-    }
-
-    public Kernel getKernel() {
-        return kernel;
-    }
-    
 }

Added: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/MainConfigurationBootstrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/MainConfigurationBootstrapper.java?view=auto&rev=519569
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/MainConfigurationBootstrapper.java (added)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/MainConfigurationBootstrapper.java Sun Mar 18 00:32:35 2007
@@ -0,0 +1,161 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.kernel.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.KernelFactory;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
+import org.apache.geronimo.kernel.log.GeronimoLogging;
+
+/**
+ *
+ * @version $Rev: 476049 $ $Date: 2006-11-17 15:35:17 +1100 (Fri, 17 Nov 2006) $
+ */
+public class MainConfigurationBootstrapper {
+    public final static String ARGUMENT_VERBOSE_SHORTFORM = "-v";
+    public final static String ARGUMENT_VERBOSE = "--verbose";
+    public final static String ARGUMENT_MORE_VERBOSE_SHORTFORM = "-vv";
+    public final static String ARGUMENT_MORE_VERBOSE = "--veryverbose";
+
+    public static String getVerboseLevel(String[] args) {
+        String verboseArg = null;
+        for (int i = 0; i < args.length; i++) {
+            verboseArg = filterVerboseArgument(args[i]);
+            if (null != verboseArg) {
+                break;
+            }
+        }
+        return verboseArg;
+    }
+
+    public static String filterVerboseArgument(String arg) {
+        if (arg.equals(ARGUMENT_VERBOSE_SHORTFORM) || arg.equals(ARGUMENT_VERBOSE)) {
+            return ARGUMENT_VERBOSE;
+        } else if (arg.equals(ARGUMENT_MORE_VERBOSE_SHORTFORM) || arg.equals(ARGUMENT_MORE_VERBOSE)) {
+            return ARGUMENT_MORE_VERBOSE;
+        }
+        return null;
+    }
+
+    public static boolean isVerboseLevel(String verboseLevel) {
+        return verboseLevel.equals(ARGUMENT_VERBOSE);
+    }
+
+    public static boolean isMoreVerboseLevel(String verboseLevel) {
+        return verboseLevel.equals(ARGUMENT_MORE_VERBOSE);
+    }
+
+    public static void main(String[] args) {
+        main(new MainConfigurationBootstrapper(), args);
+    }
+
+    public static void main(MainConfigurationBootstrapper bootstrapper, String[] args) {
+        bootstrapper.initializeLogging(args);
+        
+        Main main = bootstrapper.getMain(MainConfigurationBootstrapper.class.getClassLoader());
+
+        int exitCode;
+        ClassLoader oldTCCL = Thread.currentThread().getContextClassLoader();
+        try {
+            ClassLoader newTCCL = main.getClass().getClassLoader();
+            Thread.currentThread().setContextClassLoader(newTCCL);
+            exitCode = main.execute(args);
+        } finally {
+            Thread.currentThread().setContextClassLoader(oldTCCL);
+        }
+        System.exit(exitCode);
+    }
+
+    protected Kernel kernel;
+
+    public Main getMain(ClassLoader classLoader) {
+        try {
+            bootKernel();
+            loadBootConfiguration(classLoader);
+            loadPersistentConfigurations();
+            return getMain();
+        } catch (Exception e) {
+            if (null != kernel) {
+                kernel.shutdown();
+            }
+            e.printStackTrace();
+            System.exit(1);
+            throw new AssertionError();
+        }
+    }
+    
+    public void bootKernel() throws Exception {
+        kernel = KernelFactory.newInstance().createKernel("MainBootstrapper");
+        kernel.boot();
+
+        Runtime.getRuntime().addShutdownHook(new Thread("MainBootstrapper shutdown thread") {
+            public void run() {
+                kernel.shutdown();
+            }
+        });
+    }
+    
+    public void loadBootConfiguration(ClassLoader classLoader) throws Exception {
+        InputStream in = classLoader.getResourceAsStream("META-INF/config.ser");
+        try {
+            ConfigurationUtil.loadBootstrapConfiguration(kernel, in, classLoader, true);
+        } finally {
+            if (in != null) {
+                try {
+                    in.close();
+                } catch (IOException ignored) {
+                    // ignored
+                }
+            }
+        }
+    }
+    
+    public void loadPersistentConfigurations() throws Exception {
+    }
+
+    public Main getMain() throws Exception {
+        return (Main) kernel.getGBean(Main.class);
+    }
+
+    public Kernel getKernel() {
+        return kernel;
+    }
+    
+    protected void initializeLogging(String[] args) {
+        String verboseArg = getVerboseLevel(args);
+        
+        //
+        // FIXME: Allow -v -> INFO, -vv -> DEBUG, -vvv -> TRACE
+        //
+        
+        // This MUST be done before the first log is acquired (which the startup monitor below does)
+        // Generally we want to suppress anything but WARN until the log GBean starts up
+        GeronimoLogging level = GeronimoLogging.WARN;
+        if (verboseArg != null) {
+            if (isVerboseLevel(verboseArg)) {
+                level = GeronimoLogging.DEBUG;
+            } else if (isMoreVerboseLevel(verboseArg)) {
+                level = GeronimoLogging.TRACE;
+            }
+        }
+        GeronimoLogging.initialize(level);
+    }
+    
+}

Copied: geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/rmi/RMIClassLoaderSpiImplTest.java (from r519183, geronimo/server/trunk/modules/geronimo-system/src/test/java/org/apache/geronimo/system/rmi/RMIClassLoaderSpiImplTest.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/rmi/RMIClassLoaderSpiImplTest.java?view=diff&rev=519569&p1=geronimo/server/trunk/modules/geronimo-system/src/test/java/org/apache/geronimo/system/rmi/RMIClassLoaderSpiImplTest.java&r1=519183&p2=geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/rmi/RMIClassLoaderSpiImplTest.java&r2=519569
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/test/java/org/apache/geronimo/system/rmi/RMIClassLoaderSpiImplTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/rmi/RMIClassLoaderSpiImplTest.java Sun Mar 18 00:32:35 2007
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.geronimo.system.rmi;
+package org.apache.geronimo.kernel.rmi;
 
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -29,6 +29,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.kernel.rmi.RMIClassLoaderSpiImpl;
 
 /**
  * Unit tests for {@link RMIClassLoaderSpiImpl} class.

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ClientCommandLine.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ClientCommandLine.java?view=diff&rev=519569&r1=519568&r2=519569
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ClientCommandLine.java (original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ClientCommandLine.java Sun Mar 18 00:32:35 2007
@@ -32,48 +32,60 @@
      * @param args command line args
      */
     public static void main(String[] args) {
+        ClientCommandLine clientCommandLine = new ClientCommandLine();
+        int exitCode = clientCommandLine.execute(args);
+        System.exit(exitCode);
+    }
+
+    private static void showHelp() {
+        System.out.println();
+        System.out.println("syntax:   java -jar bin/client.jar config-name [app arg] [app arg] ...");
+        System.out.println();
+        System.out.println("The first argument should identify the Geronimo configuration that");
+        System.out.println("contains the application client you want to run.");
+        System.out.println();
+        System.out.println("The rest of the arguments will be passed as arguments to the");
+        System.out.println("application client when it is started.");
+        System.out.println();
+    }
+
+    public ClientCommandLine(Artifact configuration, String[] args) throws Exception {
+        startClient(configuration, args);
+    }
+    
+    protected ClientCommandLine() {
+    }
+    
+    public int execute(String[] args) {
         log.info("Client startup begun");
         if(args.length == 0) {
             System.out.println();
             System.out.println("ERROR: No arguments");
             showHelp();
-            System.exit(1);
+            return 1;
         } else if(args[0].equals("--help") || args[0].equals("-h") || args[0].equals("/?")) {
             showHelp();
-            System.exit(0);
+            return 0;
         }
         try {
             Artifact configuration = Artifact.create(args[0]);
             String[] clientArgs = new String[args.length -1];
             System.arraycopy(args, 1, clientArgs, 0, clientArgs.length);
-            new ClientCommandLine(configuration, clientArgs);
+            return startClient(configuration, clientArgs);
         } catch (Exception e) {
             ExceptionUtil.trimStackTrace(e);
             e.printStackTrace();
-            System.exit(2);
-            throw new AssertionError();
+            return 2;
         }
     }
-
-    private static void showHelp() {
-        System.out.println();
-        System.out.println("syntax:   java -jar bin/client.jar config-name [app arg] [app arg] ...");
-        System.out.println();
-        System.out.println("The first argument should identify the Geronimo configuration that");
-        System.out.println("contains the application client you want to run.");
-        System.out.println();
-        System.out.println("The rest of the arguments will be passed as arguments to the");
-        System.out.println("application client when it is started.");
-        System.out.println();
-    }
-
-
-    public ClientCommandLine(Artifact configuration, String[] args) throws Exception {
+    
+    protected int startClient(Artifact configuration, String[] args) throws Exception {
         Jsr77Naming naming = new Jsr77Naming();
         //this kinda sucks, but resource adapter modules deployed on the client insist on having a
         //J2EEApplication name component
         AbstractName baseName = naming.createRootName(configuration, configuration.toString(), "J2EEApplication");
         AbstractNameQuery baseNameQuery = new AbstractNameQuery(baseName);
         invokeMainGBean(Collections.singletonList(configuration), baseNameQuery, "main", args);
+        return 0;
     }
 }

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/CommandLine.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/CommandLine.java?view=diff&rev=519569&r1=519568&r2=519569
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/CommandLine.java (original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/CommandLine.java Sun Mar 18 00:32:35 2007
@@ -19,30 +19,30 @@
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Enumeration;
 import java.util.Set;
-import java.util.Collection;
-import java.net.URL;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.GeronimoEnvironment;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.InternalKernelException;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelFactory;
+import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
-import org.apache.geronimo.kernel.config.NoSuchConfigException;
 import org.apache.geronimo.kernel.config.LifecycleException;
-import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
 import org.apache.geronimo.kernel.log.GeronimoLogging;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.MissingDependencyException;
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.gbean.AbstractNameQuery;
 
 
 /**
@@ -88,20 +88,18 @@
     private AbstractName configurationName;
 
     public void invokeMainGBean(List configurations, AbstractNameQuery mainGBeanQuery, String mainMethod, String[] args) throws Exception {
-        startKernel();
-        Runtime.getRuntime().addShutdownHook(new Thread("Geronimo shutdown thread") {
-            public void run() {
-                log.info("Server shutdown begun");
-                try {
-                    stopKernel();
-                } catch (GBeanNotFoundException e) {
+        // boot the kernel
+        kernel = getBootedKernel();
 
-                }
-            }
-        });
+        initializeKernel();
+        
         loadConfigurations(configurations);
 
         log.info("Server startup completed");
+        doInvokeMainGBean(mainGBeanQuery, mainMethod, args);
+    }
+
+    protected void doInvokeMainGBean(AbstractNameQuery mainGBeanQuery, String mainMethod, String[] args) throws Exception {
         Set matches = kernel.listGBeans(mainGBeanQuery);
         if (matches.isEmpty()) {
             throw new Exception("No match for AbstractNameQuery: " + mainGBeanQuery);
@@ -117,17 +115,27 @@
                 mainMethod,
                 new Object[]{args},
                 new String[]{String[].class.getName()});
+    }
 
+    protected void initializeKernel() throws Exception {
+        loadBootstrapConfiguration();
+        
+        Runtime.getRuntime().addShutdownHook(new Thread("Geronimo shutdown thread") {
+            public void run() {
+                log.info("Server shutdown begun");
+                try {
+                    stopKernel();
+                } catch (GBeanNotFoundException e) {
+
+                }
+            }
+        });
     }
 
-    protected void startKernel() throws Exception {
+    protected void loadBootstrapConfiguration() throws Exception {
         ClassLoader classLoader = CommandLine.class.getClassLoader();
         InputStream in = classLoader.getResourceAsStream("META-INF/config.ser");
         try {
-            // boot the kernel
-            kernel = KernelFactory.newInstance().createKernel("geronimo");
-            kernel.boot();
-    
             // load the configuration
             configurationName = ConfigurationUtil.loadBootstrapConfiguration(kernel, in, classLoader);
         } finally {
@@ -141,10 +149,14 @@
         }
     }
 
-    protected void startKernel(Artifact moduleId) throws Exception {
-        // boot the kernel
+    protected Kernel getBootedKernel() throws Exception {
         kernel = KernelFactory.newInstance().createKernel("geronimo");
         kernel.boot();
+        return kernel;
+    }
+
+    protected void startKernel(Artifact moduleId) throws Exception {
+        getBootedKernel();
         ClassLoader classLoader = CommandLine.class.getClassLoader();
         for (Enumeration modules = classLoader.getResources("META-INF/config.ser"); modules.hasMoreElements(); ) {
             URL moduleDataURL = (URL) modules.nextElement();

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/Daemon.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/Daemon.java?view=diff&rev=519569&r1=519568&r2=519569
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/Daemon.java (original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/Daemon.java Sun Mar 18 00:32:35 2007
@@ -17,318 +17,62 @@
 
 package org.apache.geronimo.system.main;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.common.GeronimoEnvironment;
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.gbean.AbstractNameQuery;
-import org.apache.geronimo.kernel.Kernel;
+import java.io.IOException;
+import java.io.InputStream;
+
 import org.apache.geronimo.kernel.KernelFactory;
-import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
-import org.apache.geronimo.kernel.config.PersistentConfigurationList;
-import org.apache.geronimo.kernel.log.GeronimoLogging;
-import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.system.serverinfo.DirectoryUtils;
 
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
 
 /**
  * @version $Rev:385659 $ $Date$
  */
-public class Daemon {
-    private final static String ARGUMENT_NO_PROGRESS = "--quiet";
-    private final static String ARGUMENT_LONG_PROGRESS = "--long";
-    private final static String ARGUMENT_VERBOSE_SHORTFORM = "-v";
-    private final static String ARGUMENT_VERBOSE = "--verbose";
-    private final static String ARGUMENT_MORE_VERBOSE_SHORTFORM = "-vv";
-    private final static String ARGUMENT_MORE_VERBOSE = "--veryverbose";
-    private final static String ARGUMENT_MODULE_OVERRIDE = "--override";
-    private static boolean started = false;
-    private static Log log;
-    private StartupMonitor monitor;
-    private List configs = new ArrayList();
-    private String verboseArg = null;
-    private String noProgressArg = null;
-    private String longProgressArg = null;
-
-    private Daemon(String[] args) {
-        // Very first startup tasks
-        long start = System.currentTimeMillis();
-        // Command line arguments affect logging configuration, etc.
-        if (processArguments(args)) {
-            System.out.println("Booting Geronimo Kernel (in Java " + System.getProperty("java.version") + ")...");
-            System.out.flush();
+public class Daemon extends EmbeddedDaemon {
 
-            // Initialization tasks that must run before anything else
-            initializeSystem();
-
-            monitor.systemStarting(start);
-            doStartup();
-        } else {
-            System.exit(1);
-            throw new AssertionError();
-        }
+    private Daemon() {
+        super(null);
     }
+    
+    @Override
+    protected int initializeKernel() throws Exception {
+        ClassLoader classLoader = EmbeddedDaemon.class.getClassLoader();
 
-    private void printHelp(PrintStream out) {
-        out.println();
-        out.println("Syntax: java -jar bin/server.jar [options]");
-        out.println();
-        out.println("Available options are: ");
-        out.println("  "+ARGUMENT_NO_PROGRESS);
-        out.println("             Suppress the normal startup progress bar.  This is typically\n" +
-                    "             used when redirecting console output to a file, or starting\n" +
-                    "             the server from an IDE or other tool.");
-        out.println("  "+ARGUMENT_LONG_PROGRESS);
-        out.println("             Write startup progress to the console in a format that is\n" +
-                    "             suitable for redirecting console output to a file, or starting\n" +
-                    "             the server from an IDE or other tool (doesn't use linefeeds to\n" +
-                    "             update the progress information that is used by default if you\n" +
-                    "             don't specify " +ARGUMENT_NO_PROGRESS +" or "+ARGUMENT_LONG_PROGRESS+").\n");
-        out.println("  "+ARGUMENT_VERBOSE_SHORTFORM +" " +ARGUMENT_VERBOSE);
-        out.println("             Reduces the console log level to DEBUG, resulting in more\n" +
-                    "             console output than is normally present.");
-        out.println("  "+ARGUMENT_MORE_VERBOSE_SHORTFORM +" " +ARGUMENT_MORE_VERBOSE);
-        out.println("             Reduces the console log level to TRACE, resulting in still\n" +
-                    "             more console output.");
-        out.println();
-        out.println("  "+ARGUMENT_MODULE_OVERRIDE+" [moduleId] [moduleId] ...");
-        out.println("             USE WITH CAUTION!  Overrides the modules in\n" +
-                    "             var/config/config.xml such that only the modules listed on\n" +
-                    "             the command line will be started.  Note that many J2EE\n" +
-                    "             features depend on certain modules being started, so you\n" +
-                    "             should be very careful what you omit.  Any arguments after\n" +
-                    "             this are assumed to be module names.");
-        out.println();
-        out.println("In addition you may specify a replacement for var/config/config.xml using by setting the property\n" +
-                    "-Dorg.apache.geronimo.config.file=var/config/<my-config.xml>\n" +
-                    "This is resolved relative to the geronimo base directory.");
-        out.println();
-    }
+        // create the kernel
+        kernel = KernelFactory.newInstance().createKernel("geronimo");
 
-    /**
-     * @return true if the server startup should proceed (all arguments
-     *              make sense and the user didn't ask for help)
-     */
-    private boolean processArguments(String[] args) {
-        boolean override = false;
-        boolean help = false;
-        for (int i = 0; i < args.length; i++) {
-            if (override) {
-                configs.add(Artifact.create(args[i]));
-            } else if (args[i].equals(ARGUMENT_NO_PROGRESS)) {
-                noProgressArg = ARGUMENT_NO_PROGRESS;
-            } else if (args[i].equals(ARGUMENT_LONG_PROGRESS)) {
-                longProgressArg = ARGUMENT_LONG_PROGRESS;
-            } else if (args[i].equals(ARGUMENT_VERBOSE_SHORTFORM) || args[i].equals(ARGUMENT_VERBOSE)) {
-                if (verboseArg == null) {
-                    verboseArg = ARGUMENT_VERBOSE;
-                }
-            } else if (args[i].equals(ARGUMENT_MORE_VERBOSE_SHORTFORM) || args[i].equals(ARGUMENT_MORE_VERBOSE)) {
-                if (verboseArg == null) {
-                    verboseArg = ARGUMENT_MORE_VERBOSE;
-                }
-            } else if (args[i].equals(ARGUMENT_MODULE_OVERRIDE)) {
-                override = true;
-            } else if (args[i].equalsIgnoreCase("-help") || args[i].equalsIgnoreCase("--help") ||
-                       args[i].equalsIgnoreCase("-h") || args[i].equalsIgnoreCase("/?")) {
-                help = true;
-            } else {
-                System.out.println("Unrecognized argument: "+args[i]);
-                help = true;
-            }
-        }
-        if (help) {
-            printHelp(System.out);
-        }
-        return !help;
-    }
-
-    private void initializeSystem() {
-        if (!started) {
-            started = true;
-
-            // Perform initialization tasks common with the various Geronimo environments
-            GeronimoEnvironment.init();
-            
-            //
-            // FIXME: Allow -v -> INFO, -vv -> DEBUG, -vvv -> TRACE
-            //
-            
-            // This MUST be done before the first log is acquired (which the startup monitor below does)
-            // Generally we want to suppress anything but WARN until the log GBean starts up
-            GeronimoLogging level = GeronimoLogging.WARN;
-            if (verboseArg != null) {
-                if (verboseArg.equals(ARGUMENT_VERBOSE)) {
-                    level = GeronimoLogging.DEBUG;
-                } else if (verboseArg.equals(ARGUMENT_MORE_VERBOSE)) {
-                    level = GeronimoLogging.TRACE;
-                }
-            }
-            GeronimoLogging.initialize(level);
-            
-            log = LogFactory.getLog(Daemon.class.getName());
+        // boot the kernel
+        try {
+            kernel.boot();
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 1;
         }
 
-        if (verboseArg != null || noProgressArg != null) {
-            monitor = new SilentStartupMonitor();
-        } else {
-            if (longProgressArg != null) {
-                monitor = new LongStartupMonitor();
-            } else {
-                monitor = new ProgressBarStartupMonitor();
+        // add our shutdown hook
+        Runtime.getRuntime().addShutdownHook(new Thread("Geronimo shutdown thread") {
+            public void run() {
+                System.out.println("\rServer shutdown begun              ");
+                kernel.shutdown();
+                System.out.println("Server shutdown completed");
             }
-        }
-    }
+        });
 
-    private void doStartup() {
+        // load this configuration
+        InputStream in = classLoader.getResourceAsStream("META-INF/config.ser");
         try {
-            // Check that the tmpdir exists - if not give friendly msg and exit
-            // since we allow it to be configured in geronimo.bat and geronimo.sh
-            // (since 1.0 release) the same way Tomcat allows it to be configured.
-            String tmpDir = System.getProperty("java.io.tmpdir");
-            if (tmpDir == null || (!(new File(tmpDir)).exists()) || (!(new File(tmpDir)).isDirectory())) {
-                System.err.println("The java.io.tmpdir system property specifies a non-existent directory: "  + tmpDir);
-                System.exit(1);
-                throw new AssertionError();
-            }
-
-            // Determine the geronimo installation directory
-            File geronimoInstallDirectory = DirectoryUtils.getGeronimoInstallDirectory();
-            if (geronimoInstallDirectory == null) {
-                System.err.println("Could not determine geronimo installation directory");
-                System.exit(1);
-                throw new AssertionError();
-            }
-
-            ClassLoader classLoader = Daemon.class.getClassLoader();
-
-            // create the kernel
-            final Kernel kernel = KernelFactory.newInstance().createKernel("geronimo");
-
-            // boot the kernel
-            try {
-                kernel.boot();
-            } catch (Exception e) {
-                e.printStackTrace();
-                System.exit(1);
-                throw new AssertionError();
-            }
-
-            // add our shutdown hook
-            Runtime.getRuntime().addShutdownHook(new Thread("Geronimo shutdown thread") {
-                public void run() {
-                    System.out.println("\rServer shutdown begun              ");
-                    kernel.shutdown();
-                    System.out.println("Server shutdown completed");
-                }
-            });
-
-            // load this configuration
-            InputStream in = classLoader.getResourceAsStream("META-INF/config.ser");
-            try {
-                ConfigurationUtil.loadBootstrapConfiguration(kernel, in, classLoader);
-            } finally {
-                if (in != null) {
-                    try {
-                        in.close();
-                    } catch (IOException ignored) {
-                        // ignored
-                    }
-                }
-            }
-
-            monitor.systemStarted(kernel);
-
-            AbstractNameQuery query = new AbstractNameQuery(PersistentConfigurationList.class.getName());
-
-            if (configs.isEmpty()) {
-                // --override wasn't used (nothing explicit), see what was running before
-                Set configLists = kernel.listGBeans(query);
-                for (Iterator i = configLists.iterator(); i.hasNext();) {
-                    AbstractName configListName = (AbstractName) i.next();
-                    try {
-                        configs.addAll((List) kernel.invoke(configListName, "restore"));
-                    } catch (IOException e) {
-                        System.err.println("Unable to restore last known configurations");
-                        e.printStackTrace();
-                        kernel.shutdown();
-                        System.exit(1);
-                        throw new AssertionError();
-                    }
-                }
-            }
-
-            monitor.foundModules((Artifact[]) configs.toArray(new Artifact[configs.size()]));
-
-            // load the rest of the configurations
-            try {
-                ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
-                try {
-                    for (Iterator i = configs.iterator(); i.hasNext();) {
-                        Artifact configID = (Artifact) i.next();
-                        monitor.moduleLoading(configID);
-                        configurationManager.loadConfiguration(configID);
-                        monitor.moduleLoaded(configID);
-                        monitor.moduleStarting(configID);
-                        configurationManager.startConfiguration(configID);
-                        monitor.moduleStarted(configID);
-                    }
-                } finally {
-                    ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
-                }
-            } catch (Exception e) {
-                //Exception caught when starting configurations, starting kernel shutdown
-                monitor.serverStartFailed(e);
-                try {
-                    kernel.shutdown();
-                } catch (Exception e1) {
-                    System.err.println("Exception caught during kernel shutdown");
-                    e1.printStackTrace();
-                }
-                System.exit(1);
-                throw new AssertionError();
-            }
-
-            // Tell every persistent configuration list that the kernel is now fully started
-            Set configLists = kernel.listGBeans(query);
-            for (Iterator i = configLists.iterator(); i.hasNext();) {
-                AbstractName configListName = (AbstractName) i.next();
-                kernel.setAttribute(configListName, "kernelFullyStarted", Boolean.TRUE);
-            }
-
-            // Startup sequence is finished
-            monitor.startupFinished();
-            monitor = null;
-
-            // capture this thread until the kernel is ready to exit
-            while (kernel.isRunning()) {
+            ConfigurationUtil.loadBootstrapConfiguration(kernel, in, classLoader);
+        } finally {
+            if (in != null) {
                 try {
-                    synchronized (kernel) {
-                        kernel.wait();
-                    }
-                } catch (InterruptedException e) {
-                    // continue
+                    in.close();
+                } catch (IOException ignored) {
+                    // ignored
                 }
             }
-        } catch (Exception e) {
-            if (monitor != null) {
-                monitor.serverStartFailed(e);
-            }
-            e.printStackTrace();
-            System.exit(1);
-            throw new AssertionError();
         }
+        return 0;
     }
-
+    
     /**
      * Static entry point allowing a Kernel to be run from the command line.
      *
@@ -339,6 +83,6 @@
      * @param args the command line arguments
      */
     public static void main(String[] args) {
-        new Daemon(args);
+        new Daemon().execute(args);
     }
 }

Added: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedClientCommandLine.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedClientCommandLine.java?view=auto&rev=519569
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedClientCommandLine.java (added)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedClientCommandLine.java Sun Mar 18 00:32:35 2007
@@ -0,0 +1,60 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.system.main;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.util.Main;
+
+/**
+ * @version $Revision: 476049 $ $Date: 2006-11-17 15:35:17 +1100 (Fri, 17 Nov 2006) $
+ */
+public class EmbeddedClientCommandLine extends ClientCommandLine implements Main {
+    
+    private final Kernel kernel;
+
+    public EmbeddedClientCommandLine(Kernel kernel) {
+        if (null == kernel) {
+            throw new IllegalArgumentException("kernel is required");
+        }
+        this.kernel = kernel;
+    }
+
+    @Override
+    protected Kernel getBootedKernel() throws Exception {
+        return kernel;
+    }
+    
+    @Override
+    protected void initializeKernel() throws Exception {
+    }
+    
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(EmbeddedClientCommandLine.class, "EmbeddedClientCommandLine");
+        infoFactory.addAttribute("kernel", Kernel.class, false);
+        infoFactory.setConstructor(new String[]{"kernel"});
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+    
+}

Added: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java?view=auto&rev=519569
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java (added)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java Sun Mar 18 00:32:35 2007
@@ -0,0 +1,324 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.system.main;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.common.GeronimoEnvironment;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
+import org.apache.geronimo.kernel.config.PersistentConfigurationList;
+import org.apache.geronimo.kernel.log.GeronimoLogging;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.util.Main;
+import org.apache.geronimo.kernel.util.MainConfigurationBootstrapper;
+import org.apache.geronimo.system.serverinfo.DirectoryUtils;
+
+
+/**
+ * @version $Rev:385659 $ $Date: 2007-03-07 14:40:07 +1100 (Wed, 07 Mar 2007) $
+ */
+public class EmbeddedDaemon implements Main {
+    private final static String ARGUMENT_NO_PROGRESS = "--quiet";
+    private final static String ARGUMENT_LONG_PROGRESS = "--long";
+    private final static String ARGUMENT_MODULE_OVERRIDE = "--override";
+    private static boolean started = false;
+    private static Log log;
+    private StartupMonitor monitor;
+    protected Kernel kernel;
+    private List configs = new ArrayList();
+    private String noProgressArg = null;
+    private String longProgressArg = null;
+    private String verboseArg;
+
+    public EmbeddedDaemon(Kernel kernel) {
+        this.kernel = kernel;
+    }
+    
+    public int execute(String[] args) {
+        // Very first startup tasks
+        long start = System.currentTimeMillis();
+        // Command line arguments affect logging configuration, etc.
+        if (processArguments(args)) {
+            System.out.println("Booting Geronimo Kernel (in Java " + System.getProperty("java.version") + ")...");
+            System.out.flush();
+
+            // Initialization tasks that must run before anything else
+            initializeSystem();
+
+            monitor.systemStarting(start);
+            return doStartup();
+        } else {
+            return 1;
+        }
+    }
+
+    private void printHelp(PrintStream out) {
+        out.println();
+        out.println("Syntax: java -jar bin/server.jar [options]");
+        out.println();
+        out.println("Available options are: ");
+        out.println("  "+ARGUMENT_NO_PROGRESS);
+        out.println("             Suppress the normal startup progress bar.  This is typically\n" +
+                    "             used when redirecting console output to a file, or starting\n" +
+                    "             the server from an IDE or other tool.");
+        out.println("  "+ARGUMENT_LONG_PROGRESS);
+        out.println("             Write startup progress to the console in a format that is\n" +
+                    "             suitable for redirecting console output to a file, or starting\n" +
+                    "             the server from an IDE or other tool (doesn't use linefeeds to\n" +
+                    "             update the progress information that is used by default if you\n" +
+                    "             don't specify " +ARGUMENT_NO_PROGRESS +" or "+ARGUMENT_LONG_PROGRESS+").\n");
+        out.println("  "+MainConfigurationBootstrapper.ARGUMENT_VERBOSE_SHORTFORM +" " +MainConfigurationBootstrapper.ARGUMENT_VERBOSE);
+        out.println("             Reduces the console log level to DEBUG, resulting in more\n" +
+                    "             console output than is normally present.");
+        out.println("  "+MainConfigurationBootstrapper.ARGUMENT_MORE_VERBOSE_SHORTFORM +" " +MainConfigurationBootstrapper.ARGUMENT_MORE_VERBOSE);
+        out.println("             Reduces the console log level to TRACE, resulting in still\n" +
+                    "             more console output.");
+        out.println();
+        out.println("  "+ARGUMENT_MODULE_OVERRIDE+" [moduleId] [moduleId] ...");
+        out.println("             USE WITH CAUTION!  Overrides the modules in\n" +
+                    "             var/config/config.xml such that only the modules listed on\n" +
+                    "             the command line will be started.  Note that many J2EE\n" +
+                    "             features depend on certain modules being started, so you\n" +
+                    "             should be very careful what you omit.  Any arguments after\n" +
+                    "             this are assumed to be module names.");
+        out.println();
+        out.println("In addition you may specify a replacement for var/config/config.xml using by setting the property\n" +
+                    "-Dorg.apache.geronimo.config.file=var/config/<my-config.xml>\n" +
+                    "This is resolved relative to the geronimo base directory.");
+        out.println();
+    }
+
+    /**
+     * @return true if the server startup should proceed (all arguments
+     *              make sense and the user didn't ask for help)
+     */
+    private boolean processArguments(String[] args) {
+        verboseArg = MainConfigurationBootstrapper.getVerboseLevel(args);
+
+        boolean override = false;
+        boolean help = false;
+        for (int i = 0; i < args.length; i++) {
+            if (override) {
+                configs.add(Artifact.create(args[i]));
+            } else if (args[i].equals(ARGUMENT_NO_PROGRESS)) {
+                noProgressArg = ARGUMENT_NO_PROGRESS;
+            } else if (args[i].equals(ARGUMENT_LONG_PROGRESS)) {
+                longProgressArg = ARGUMENT_LONG_PROGRESS;
+            } else if (args[i].equals(ARGUMENT_MODULE_OVERRIDE)) {
+                override = true;
+            } else if (null != MainConfigurationBootstrapper.filterVerboseArgument(args[i])) {
+                ;
+            } else if (args[i].equalsIgnoreCase("-help") || args[i].equalsIgnoreCase("--help") ||
+                       args[i].equalsIgnoreCase("-h") || args[i].equalsIgnoreCase("/?")) {
+                help = true;
+            } else {
+                System.out.println("Unrecognized argument: "+args[i]);
+                help = true;
+            }
+        }
+        if (help) {
+            printHelp(System.out);
+        }
+        return !help;
+    }
+
+    protected void initializeSystem() {
+        if (!started) {
+            started = true;
+
+            // Perform initialization tasks common with the various Geronimo environments
+            GeronimoEnvironment.init();
+            
+            initializeLogging();
+        }
+
+        initializeMonitor();
+    }
+
+    protected void initializeLogging() {
+        //
+        // FIXME: Allow -v -> INFO, -vv -> DEBUG, -vvv -> TRACE
+        //
+        
+        // This MUST be done before the first log is acquired (which the startup monitor below does)
+        // Generally we want to suppress anything but WARN until the log GBean starts up
+        GeronimoLogging level = GeronimoLogging.WARN;
+        if (verboseArg != null) {
+            if (MainConfigurationBootstrapper.isVerboseLevel(verboseArg)) {
+                level = GeronimoLogging.DEBUG;
+            } else if (MainConfigurationBootstrapper.isMoreVerboseLevel(verboseArg)) {
+                level = GeronimoLogging.TRACE;
+            }
+        }
+        GeronimoLogging.initialize(level);
+        
+        log = LogFactory.getLog(EmbeddedDaemon.class.getName());
+    }
+
+    protected void initializeMonitor() {
+        if (verboseArg != null || noProgressArg != null) {
+            monitor = new SilentStartupMonitor();
+        } else {
+            if (longProgressArg != null) {
+                monitor = new LongStartupMonitor();
+            } else {
+                monitor = new ProgressBarStartupMonitor();
+            }
+        }
+    }
+
+    protected int doStartup() {
+        try {
+            // Check that the tmpdir exists - if not give friendly msg and exit
+            // since we allow it to be configured in geronimo.bat and geronimo.sh
+            // (since 1.0 release) the same way Tomcat allows it to be configured.
+            String tmpDir = System.getProperty("java.io.tmpdir");
+            if (tmpDir == null || (!(new File(tmpDir)).exists()) || (!(new File(tmpDir)).isDirectory())) {
+                System.err.println("The java.io.tmpdir system property specifies a non-existent directory: "  + tmpDir);
+                return 1;
+            }
+
+            // Determine the geronimo installation directory
+            File geronimoInstallDirectory = DirectoryUtils.getGeronimoInstallDirectory();
+            if (geronimoInstallDirectory == null) {
+                System.err.println("Could not determine geronimo installation directory");
+                return 1;
+            }
+
+            int exitCode = initializeKernel();
+            if (0 != exitCode) {
+                return exitCode;
+            }
+
+            monitor.systemStarted(kernel);
+
+            AbstractNameQuery query = new AbstractNameQuery(PersistentConfigurationList.class.getName());
+
+            if (configs.isEmpty()) {
+                // --override wasn't used (nothing explicit), see what was running before
+                Set configLists = kernel.listGBeans(query);
+                for (Iterator i = configLists.iterator(); i.hasNext();) {
+                    AbstractName configListName = (AbstractName) i.next();
+                    try {
+                        configs.addAll((List) kernel.invoke(configListName, "restore"));
+                    } catch (IOException e) {
+                        System.err.println("Unable to restore last known configurations");
+                        e.printStackTrace();
+                        shutdownKernel();
+                        return 1;
+                    }
+                }
+            }
+
+            monitor.foundModules((Artifact[]) configs.toArray(new Artifact[configs.size()]));
+
+            // load the rest of the configurations
+            try {
+                ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
+                try {
+                    for (Iterator i = configs.iterator(); i.hasNext();) {
+                        Artifact configID = (Artifact) i.next();
+                        monitor.moduleLoading(configID);
+                        configurationManager.loadConfiguration(configID);
+                        monitor.moduleLoaded(configID);
+                        monitor.moduleStarting(configID);
+                        configurationManager.startConfiguration(configID);
+                        monitor.moduleStarted(configID);
+                    }
+                } finally {
+                    ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
+                }
+            } catch (Exception e) {
+                //Exception caught when starting configurations, starting kernel shutdown
+                monitor.serverStartFailed(e);
+                shutdownKernel();
+                return 1;
+            }
+
+            // Tell every persistent configuration list that the kernel is now fully started
+            Set configLists = kernel.listGBeans(query);
+            for (Iterator i = configLists.iterator(); i.hasNext();) {
+                AbstractName configListName = (AbstractName) i.next();
+                kernel.setAttribute(configListName, "kernelFullyStarted", Boolean.TRUE);
+            }
+
+            // Startup sequence is finished
+            monitor.startupFinished();
+            monitor = null;
+
+            // capture this thread until the kernel is ready to exit
+            while (kernel.isRunning()) {
+                try {
+                    synchronized (kernel) {
+                        kernel.wait();
+                    }
+                } catch (InterruptedException e) {
+                    // continue
+                }
+            }
+        } catch (Exception e) {
+            if (monitor != null) {
+                monitor.serverStartFailed(e);
+            }
+            e.printStackTrace();
+            return 1;
+        }
+        return 0;
+    }
+
+    protected void shutdownKernel() {
+        try {
+            kernel.shutdown();
+        } catch (Exception e1) {
+            System.err.println("Exception caught during kernel shutdown");
+            e1.printStackTrace();
+        }
+    }
+
+    protected int initializeKernel() throws Exception {
+        return 0;
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(EmbeddedDaemon.class, "EmbeddedDaemon");
+        infoFactory.addAttribute("kernel", Kernel.class, false);
+        infoFactory.setConstructor(new String[]{"kernel"});
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+    
+}



Mime
View raw message