geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r314753 [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...
Date Wed, 12 Oct 2005 02:27:40 GMT
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=314753&r1=314752&r2=314753&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 Tue
Oct 11 19:27:12 2005
@@ -39,6 +39,7 @@
 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.log.GeronimoLogging;
 import org.apache.geronimo.system.jmx.MBeanServerKernelBridge;
@@ -156,6 +157,7 @@
 
             // todo: JNB for now we clear out the dependency list but we really need a way
to resolve them
             configuration.setAttribute("dependencies", Collections.EMPTY_LIST);
+            configuration.setAttribute("baseURL", classLoader.getResource("/"));
 
             // create a mbean server
             MBeanServer mbeanServer = MBeanServerFactory.createMBeanServer("geronimo");
@@ -175,7 +177,7 @@
 
             // load this configuration into the kernel
             kernel.loadGBean(configuration, classLoader);
-            kernel.setAttribute(configName, "baseURL", classLoader.getResource("/"));
+            kernel.startGBean(configName);
 
             // add our shutdown hook
             Runtime.getRuntime().addShutdownHook(new Thread("Shutdown Thread") {
@@ -196,7 +198,8 @@
             kernel.startGBean(mbeanServerKernelBridgeName);
 
             // start this configuration
-            kernel.startRecursiveGBean(configuration.getName());
+            kernel.invoke(configName, "loadGBeans", new Object[] {null}, new String[] {ManageableAttributeStore.class.getName()});
+            kernel.invoke(configName, "startRecursiveGBeans");
             monitor.systemStarted(kernel);
 
             if (configs.isEmpty()) {
@@ -230,7 +233,7 @@
                         monitor.configurationStarting(configID);
                         for (Iterator iterator = list.iterator(); iterator.hasNext();) {
                             ObjectName name = (ObjectName) iterator.next();
-                             kernel.startRecursiveGBean(name);
+                            configurationManager.start(name);
                         }
                         monitor.configurationStarted(configID);
                     }

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=314753&r1=314752&r2=314753&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
Tue Oct 11 19:27:12 2005
@@ -79,7 +79,7 @@
 
         // load and start the config
         ObjectName configName = configurationManager.load(uri);
-        kernel.startRecursiveGBean(configName);
+        configurationManager.start(configName);
 
         // make sure the config and the enabled gbean are running
         assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(configName));
@@ -102,7 +102,7 @@
 
         // now reload and restart the config
         configName = configurationManager.load(uri);
-        kernel.startRecursiveGBean(configName);
+        configurationManager.start(configName);
 
         // 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=314753&r1=314752&r2=314753&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
Tue Oct 11 19:27:12 2005
@@ -70,6 +70,7 @@
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.config.ManageableAttributeStore;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.security.SecurityServiceImpl;
@@ -187,10 +188,12 @@
         GBeanData configData = earContext.getConfigurationGBeanData();
         configData.setAttribute("baseURL", path.toURL());
         kernel.loadGBean(configData, cl);
-
-        kernel.startRecursiveGBean(configData.getName());
-        if (kernel.getGBeanState(configData.getName()) != State.RUNNING_INDEX) {
-            fail("gbean not started: " + configData.getName());
+        ObjectName configName = configData.getName();
+        kernel.startGBean(configName);
+        kernel.invoke(configName, "loadGBeans", new Object[] {null}, new String[] {ManageableAttributeStore.class.getName()});
+        kernel.invoke(configName, "startRecursiveGBeans");
+        if (kernel.getGBeanState(configName) != State.RUNNING_INDEX) {
+            fail("gbean not started: " + configName);
         }
 
         assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,j2eeType=WebModule,name="
+ name)));
@@ -205,13 +208,15 @@
 
         //If we got here with no errors, then Tomcat deployed the war and loaded the classes
 
-        kernel.stopGBean(configData.getName());
-        kernel.unloadGBean(configData.getName());
+        kernel.stopGBean(configName);
+        kernel.unloadGBean(configName);
 
         kernel.loadGBean(configData, cl);
-        kernel.startRecursiveGBean(configData.getName());
-        kernel.stopGBean(configData.getName());
-        kernel.unloadGBean(configData.getName());
+        kernel.startGBean(configName);
+        kernel.invoke(configName, "loadGBeans", new Object[] {null}, new String[] {ManageableAttributeStore.class.getName()});
+        kernel.invoke(configName, "startRecursiveGBeans");
+        kernel.stopGBean(configName);
+        kernel.unloadGBean(configName);
     }
 
     private EARContext createEARContext(File outputPath, URI id)

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=314753&r1=314752&r2=314753&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
Tue Oct 11 19:27:12 2005
@@ -26,15 +26,14 @@
 import java.util.List;
 import java.util.StringTokenizer;
 import javax.management.ObjectName;
-import javax.management.MalformedObjectNameException;
 
 import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.kernel.KernelFactory;
 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.InvalidConfigException;
+import org.apache.geronimo.kernel.config.ManageableAttributeStore;
 import org.apache.geronimo.kernel.log.GeronimoLogging;
 
 /**
@@ -106,14 +105,16 @@
         URI configurationId = (URI) configuration.getAttribute("id");
         ObjectName configName = Configuration.getConfigurationObjectName(configurationId);
         configuration.setName(configName);
+        configuration.setAttribute("baseURL", systemURL);
 
         // build a basic kernel without a configuration-store, our configuration store is
         Kernel kernel = KernelFactory.newInstance().createKernel(getKernelName());
         kernel.boot();
 
         kernel.loadGBean(configuration, this.getClass().getClassLoader());
-        kernel.setAttribute(configName, "baseURL", systemURL);
-        kernel.startRecursiveGBean(configName);
+        kernel.startGBean(configName);
+        kernel.invoke(configName, "loadGBeans", new Object[] {null}, new String[] {ManageableAttributeStore.class.getName()});
+        kernel.invoke(configName, "startRecursiveGBeans");
 
         // load the rest of the configuration listed on the command line
         ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
@@ -123,7 +124,7 @@
                 List list = configurationManager.loadRecursive(configID);
                 for (Iterator iterator = list.iterator(); iterator.hasNext();) {
                     ObjectName name = (ObjectName) iterator.next();
-                    kernel.startRecursiveGBean(name);
+                    configurationManager.start(name);
                     System.out.println("started gbean: " + name);
                 }
             }

Modified: geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenAttributeStore.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenAttributeStore.java?rev=314753&r1=314752&r2=314753&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenAttributeStore.java
(original)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenAttributeStore.java
Tue Oct 11 19:27:12 2005
@@ -17,11 +17,14 @@
 package org.apache.geronimo.plugin.packaging;
 
 import java.io.IOException;
+import java.net.URI;
+import java.util.Collection;
 import javax.management.ObjectName;
 
 import org.apache.geronimo.gbean.GAttributeInfo;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.kernel.config.ManageableAttributeStore;
 
 /**
@@ -32,6 +35,10 @@
 
     public MavenAttributeStore(String objectName) {
         this.objectName = objectName;
+    }
+
+    public Collection setAttributes(URI configurationName, Collection datas) {
+        return datas;
     }
 
     public String getObjectName() {

Modified: geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java?rev=314753&r1=314752&r2=314753&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java
(original)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java
Tue Oct 11 19:27:12 2005
@@ -91,13 +91,7 @@
             throw new InvalidConfigException("Cannot convert id to ObjectName: ", e);
         }
         config.setName(name);
-        ObjectName pattern;
-        try {
-            pattern = attributeStore == null ? null : new ObjectName(attributeStore.getObjectName());
-        } catch (MalformedObjectNameException e) {
-            throw new InvalidConfigException("Invalid ObjectName for AttributeStore: " +
attributeStore.getObjectName());
-        }
-        config.setReferencePattern("AttributeStore", pattern);
+        config.setAttribute("baseURL", baseURL);
 
         try {
             kernel.loadGBean(config, Configuration.class.getClassLoader());
@@ -105,19 +99,9 @@
             throw new InvalidConfigException("Unable to register configuration", e);
         }
 
-        try {
-            kernel.setAttribute(name, "baseURL", baseURL);
-        } catch (Exception e) {
-            try {
-                kernel.unloadGBean(name);
-            } catch (Exception ignored) {
-                // ignore
-            }
-            throw new InvalidConfigException("Cannot set baseURL", e);
-        }
-
         return name;
     }
+
 
     public boolean containsConfiguration(URI configID) {
         return repository.hasURI(configID);

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=314753&r1=314752&r2=314753&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
Tue Oct 11 19:27:12 2005
@@ -228,7 +228,7 @@
                 List configs = configurationManager.loadRecursive(deploymentConfig);
                 for (int i = 0; i < configs.size(); i++) {
                     ObjectName configName = (ObjectName) configs.get(i);
-                    kernel.startRecursiveGBean(configName);
+                    configurationManager.start(configName);
                 }
             }
         } finally {
@@ -283,6 +283,7 @@
 
         GBeanData configManagerGBean = new GBeanData(CONFIGMANAGER_NAME, ConfigurationManagerImpl.GBEAN_INFO);
         configManagerGBean.setReferencePattern("Stores", CONFIGSTORE_NAME);
+        configManagerGBean.setReferencePattern("AttributeStore", ATTRIBUTESTORE_NAME);
         kernel.loadGBean(configManagerGBean, cl);
         kernel.startGBean(CONFIGMANAGER_NAME);
 



Mime
View raw message