geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: rev 56502 - in geronimo/trunk/modules: kernel/src/java/org/apache/geronimo/kernel/config system/src/java/org/apache/geronimo/system/main
Date Wed, 03 Nov 2004 18:27:03 GMT
Author: jboynes
Date: Wed Nov  3 10:27:01 2004
New Revision: 56502

Modified:
   geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
   geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java
Log:
allow for multiple persistent config lists

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/PersistentConfigurationList.java
Wed Nov  3 10:27:01 2004
@@ -29,8 +29,6 @@
  * @version $Rev$ $Date$
  */
 public interface PersistentConfigurationList {
-    public static final ObjectName OBJECT_NAME = JMXUtil.getObjectName("geronimo.boot:role=PersistentConfigurationList");
-
     void save() throws IOException;
 
     List restore() throws IOException;

Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java
==============================================================================
--- 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	Wed
Nov  3 10:27:01 2004
@@ -24,14 +24,15 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
 import javax.management.ObjectName;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
-import org.apache.geronimo.kernel.config.PersistentConfigurationList;
 import org.apache.geronimo.kernel.log.GeronimoLogging;
 import org.apache.geronimo.system.url.GeronimoURLFactory;
 
@@ -124,9 +125,11 @@
 
             if (configs.isEmpty()) {
                 // nothing explicit, see what was running before
-                if (kernel.isLoaded(PersistentConfigurationList.OBJECT_NAME)) {
+                Set configLists = kernel.listGBeans(JMXUtil.getObjectName("*:role=PersistentConfigurationList,*"));
+                for (Iterator i = configLists.iterator(); i.hasNext();) {
+                    ObjectName configListName = (ObjectName) i.next();
                     try {
-                        configs = (List) kernel.invoke(PersistentConfigurationList.OBJECT_NAME,
"restore");
+                        configs = (List) kernel.invoke(configListName, "restore");
                     } catch (IOException e) {
                         System.err.println("Unable to restore last known configurations");
                         e.printStackTrace();

Mime
View raw message