You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2005/10/18 03:38:10 UTC

svn commit: r326008 [2/2] - in /geronimo/trunk: applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/ applications/console-standard/src/java...

Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java?rev=326008&r1=326007&r2=326008&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java (original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java Mon Oct 17 18:37:46 2005
@@ -23,10 +23,10 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
-import java.util.Collections;
 import javax.management.MBeanServer;
 import javax.management.MBeanServerFactory;
 import javax.management.ObjectName;
@@ -34,13 +34,14 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.GBeanQuery;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelFactory;
+import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ManageableAttributeStore;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.config.PersistentConfigurationList;
 import org.apache.geronimo.kernel.log.GeronimoLogging;
 import org.apache.geronimo.system.jmx.MBeanServerKernelBridge;
 import org.apache.geronimo.system.serverinfo.DirectoryUtils;
@@ -49,13 +50,11 @@
  * @version $Rev$ $Date$
  */
 public class Daemon {
-    private final static String ARGUMENT_NO_PROGRESS="-quiet";
-    private final static String ARGUMENT_VERBOSE="-v";
-    private final static String ARGUMENT_MORE_VERBOSE="-vv";
+    private final static String ARGUMENT_NO_PROGRESS = "-quiet";
+    private final static String ARGUMENT_VERBOSE = "-v";
+    private final static String ARGUMENT_MORE_VERBOSE = "-vv";
     private static boolean started = false;
     private static Log log;
-    private static final ObjectName PERSISTENT_CONFIGURATION_LIST_NAME_QUERY = JMXUtil.getObjectName("*:j2eeType=PersistentConfigurationList,*");
-
     private StartupMonitor monitor;
     private List configs = new ArrayList();
     private String verboseArg = null;
@@ -64,7 +63,7 @@
     private Daemon(String[] args) {
         // Very first startup tasks
         long start = System.currentTimeMillis();
-        System.out.println("Booting Geronimo Kernel (in Java "+System.getProperty("java.version")+")...");
+        System.out.println("Booting Geronimo Kernel (in Java " + System.getProperty("java.version") + ")...");
         System.out.flush();
 
         // Command line arguments affect logging configuration, etc.
@@ -81,14 +80,14 @@
 
     private void processArguments(String[] args) {
         for (int i = 0; i < args.length; i++) {
-            if(args[i].equals(ARGUMENT_NO_PROGRESS)) {
+            if (args[i].equals(ARGUMENT_NO_PROGRESS)) {
                 progressArg = ARGUMENT_NO_PROGRESS;
             } else if (args[i].equals(ARGUMENT_VERBOSE)) {
-                if(verboseArg == null) {
+                if (verboseArg == null) {
                     verboseArg = ARGUMENT_VERBOSE;
                 }
             } else if (args[i].equals(ARGUMENT_MORE_VERBOSE)) {
-                if(verboseArg == null) {
+                if (verboseArg == null) {
                     verboseArg = ARGUMENT_MORE_VERBOSE;
                 }
             } else {
@@ -105,7 +104,7 @@
     }
 
     private void initializeSystem() {
-        if(!started) {
+        if (!started) {
             started = true;
 
             // This MUST be done before the first log is acquired (WHICH THE STARTUP MONITOR 5 LINES LATER DOES!)
@@ -113,7 +112,7 @@
             log = LogFactory.getLog(Daemon.class.getName());
         }
 
-        if(verboseArg != null || progressArg != null) {
+        if (verboseArg != null || progressArg != null) {
             monitor = new SilentStartupMonitor();
         } else {
             monitor = new ProgressBarStartupMonitor();
@@ -198,13 +197,15 @@
             kernel.startGBean(mbeanServerKernelBridgeName);
 
             // start this configuration
-            kernel.invoke(configName, "loadGBeans", new Object[] {null}, new String[] {ManageableAttributeStore.class.getName()});
+            kernel.invoke(configName, "loadGBeans", new Object[]{null}, new String[]{ManageableAttributeStore.class.getName()});
             kernel.invoke(configName, "startRecursiveGBeans");
             monitor.systemStarted(kernel);
 
+            GBeanQuery query = new GBeanQuery(null, PersistentConfigurationList.class.getName());
+
             if (configs.isEmpty()) {
                 // nothing explicit, see what was running before
-                Set configLists = kernel.listGBeans(PERSISTENT_CONFIGURATION_LIST_NAME_QUERY);
+                Set configLists = kernel.listGBeans(query);
                 for (Iterator i = configLists.iterator(); i.hasNext();) {
                     ObjectName configListName = (ObjectName) i.next();
                     try {
@@ -232,7 +233,7 @@
                         monitor.configurationLoaded(configID);
                         monitor.configurationStarting(configID);
                         for (Iterator iterator = list.iterator(); iterator.hasNext();) {
-                            ObjectName name = (ObjectName) iterator.next();
+                            URI name = (URI) iterator.next();
                             configurationManager.start(name);
                         }
                         monitor.configurationStarted(configID);
@@ -254,7 +255,7 @@
             }
 
             // Tell every persistent configuration list that the kernel is now fully started
-            Set configLists = kernel.listGBeans(PERSISTENT_CONFIGURATION_LIST_NAME_QUERY);
+            Set configLists = kernel.listGBeans(query);
             for (Iterator i = configLists.iterator(); i.hasNext();) {
                 ObjectName configListName = (ObjectName) i.next();
                 kernel.setAttribute(configListName, "kernelFullyStarted", Boolean.TRUE);
@@ -276,7 +277,7 @@
                 }
             }
         } catch (Exception e) {
-            if(monitor != null) {
+            if (monitor != null) {
                 monitor.serverStartFailed(e);
             }
             e.printStackTrace();

Modified: geronimo/trunk/modules/system/src/schema/local-attribute.xsd
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/schema/local-attribute.xsd?rev=326008&r1=326007&r2=326008&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/schema/local-attribute.xsd (original)
+++ geronimo/trunk/modules/system/src/schema/local-attribute.xsd Mon Oct 17 18:37:46 2005
@@ -59,6 +59,7 @@
             <xsd:element name="gbean" type="atts:gbeanType" minOccurs="0" maxOccurs="unlimited" />
         </xsd:sequence>
         <xsd:attribute name="name" type="xs:string" use="required"/>
+        <xsd:attribute name="load" type="xs:boolean" use="optional" default="true"/>
     </xsd:complexType>
 
     <xsd:complexType name="gbeanType">
@@ -78,6 +79,7 @@
             <xsd:element name="attribute" type="atts:attributeType" minOccurs="0" maxOccurs="unlimited" />
         </xsd:sequence>
         <xsd:attribute name="name" type="xs:string" use="required"/>
+        <xsd:attribute name="load" type="xs:boolean" use="optional" default="true"/>
     </xsd:complexType>
 
     <xsd:complexType name="attributeType">

Modified: geronimo/trunk/modules/system/src/test/org/apache/geronimo/system/configuration/LocalConfigStoreTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/test/org/apache/geronimo/system/configuration/LocalConfigStoreTest.java?rev=326008&r1=326007&r2=326008&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/test/org/apache/geronimo/system/configuration/LocalConfigStoreTest.java (original)
+++ geronimo/trunk/modules/system/src/test/org/apache/geronimo/system/configuration/LocalConfigStoreTest.java Mon Oct 17 18:37:46 2005
@@ -79,7 +79,7 @@
 
         // load and start the config
         ObjectName configName = configurationManager.load(uri);
-        configurationManager.start(configName);
+        configurationManager.start(uri);
 
         // make sure the config and the enabled gbean are running
         assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(configName));
@@ -94,15 +94,15 @@
 
         kernel.invoke(configName, "saveState");
         // stop and unload the config
-        kernel.stopGBean(configName);
-        kernel.unloadGBean(configName);
+        configurationManager.stop(uri);
+        configurationManager.unload(uri);
 
         // assure it was unloaded
         assertFalse(kernel.isLoaded(configName));
 
         // now reload and restart the config
         configName = configurationManager.load(uri);
-        configurationManager.start(configName);
+        configurationManager.start(uri);
 
         // make sure the value was reloaded correctly
         assertEquals("9900990099", kernel.getAttribute(gbeanName1, "value"));

Modified: geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?rev=326008&r1=326007&r2=326008&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java (original)
+++ geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java Mon Oct 17 18:37:46 2005
@@ -368,8 +368,8 @@
         kernel.startGBean(configurationManagerName);
         ConfigurationManager configurationManager = (ConfigurationManager) kernel.getProxyManager().createProxy(configurationManagerName, ConfigurationManager.class);
 
-        ObjectName baseConfigName = configurationManager.load((URI) parentId.get(0));
-        kernel.startGBean(baseConfigName);
+        configurationManager.load((URI) parentId.get(0));
+        configurationManager.start((URI) parentId.get(0));
 
         serverInfoName = new ObjectName("geronimo.system:name=ServerInfo");
         serverInfoGBean = new GBeanData(serverInfoName, BasicServerInfo.GBEAN_INFO);

Modified: geronimo/trunk/plugins/geronimo-deployment-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/StartServer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-deployment-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/StartServer.java?rev=326008&r1=326007&r2=326008&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-deployment-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/StartServer.java (original)
+++ geronimo/trunk/plugins/geronimo-deployment-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/StartServer.java Mon Oct 17 18:37:46 2005
@@ -123,7 +123,7 @@
                 URI configID = (URI) i.next();
                 List list = configurationManager.loadRecursive(configID);
                 for (Iterator iterator = list.iterator(); iterator.hasNext();) {
-                    ObjectName name = (ObjectName) iterator.next();
+                    URI name = (URI) iterator.next();
                     configurationManager.start(name);
                     System.out.println("started gbean: " + name);
                 }

Modified: geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java?rev=326008&r1=326007&r2=326008&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java (original)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java Mon Oct 17 18:37:46 2005
@@ -227,7 +227,7 @@
             if (!configurationManager.isLoaded(deploymentConfig)) {
                 List configs = configurationManager.loadRecursive(deploymentConfig);
                 for (int i = 0; i < configs.size(); i++) {
-                    ObjectName configName = (ObjectName) configs.get(i);
+                    URI configName = (URI) configs.get(i);
                     configurationManager.start(configName);
                 }
             }