geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r231345 - in /geronimo/trunk/modules: deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/ deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/ deployment/src/java/org/apache/geronimo/deployment/ kernel/src/java/or...
Date Wed, 10 Aug 2005 22:40:49 GMT
Author: djencks
Date: Wed Aug 10 15:40:39 2005
New Revision: 231345

URL: http://svn.apache.org/viewcvs?rev=231345&view=rev
Log:
GERONIMO-484 release proxies when we are done with them

Modified:
    geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
    geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java
    geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java
    geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StopCommand.java
    geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java
    geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/JMXProxyManager.java
    geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java
    geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java

Modified: geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java?rev=231345&r1=231344&r2=231345&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
(original)
+++ geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
Wed Aug 10 15:40:39 2005
@@ -78,6 +78,7 @@
 
     public void release() {
         try {
+            ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
             jmxConnector.close();
         } catch (IOException e) {
             throw (IllegalStateException) new IllegalStateException("Unable to close connection").initCause(e);

Modified: geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java?rev=231345&r1=231344&r2=231345&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java
(original)
+++ geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java
Wed Aug 10 15:40:39 2005
@@ -71,47 +71,51 @@
             }
 
             ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
-            for (int i = 0; i < modules.length; i++) {
-                TargetModuleIDImpl module = (TargetModuleIDImpl) modules[i];
+            try {
+                for (int i = 0; i < modules.length; i++) {
+                    TargetModuleIDImpl module = (TargetModuleIDImpl) modules[i];
 
-                URI configID = URI.create(module.getModuleID());
-                ObjectName configName = Configuration.getConfigurationObjectName(configID);
-                try {
-                    kernel.stopGBean(configName);
-                    updateStatus("Stopped "+configID);
-                } catch (GBeanNotFoundException e) {
-                    if(e.getGBeanName().equals(configName)) {
-                        // The module isn't running -- that's OK
-                    } else throw e;
-                }
-                try {
-                    configurationManager.unload(configID);
-                    updateStatus("Unloaded "+configID);
-                } catch(InternalKernelException e) {
-                    Exception cause = (Exception)e.getCause();
-                    if(cause instanceof NoSuchConfigException) {
+                    URI configID = URI.create(module.getModuleID());
+                    ObjectName configName = Configuration.getConfigurationObjectName(configID);
+                    try {
+                        kernel.stopGBean(configName);
+                        updateStatus("Stopped "+configID);
+                    } catch (GBeanNotFoundException e) {
+                        if(e.getGBeanName().equals(configName)) {
+                            // The module isn't running -- that's OK
+                        } else throw e;
+                    }
+                    try {
+                        configurationManager.unload(configID);
+                        updateStatus("Unloaded "+configID);
+                    } catch(InternalKernelException e) {
+                        Exception cause = (Exception)e.getCause();
+                        if(cause instanceof NoSuchConfigException) {
+                            // The modules isn't loaded -- that's OK
+                        } else {
+                            throw cause;
+                        }
+                    } catch (NoSuchConfigException e) {
                         // The modules isn't loaded -- that's OK
-                    } else {
-                        throw cause;
                     }
-                } catch (NoSuchConfigException e) {
-                    // The modules isn't loaded -- that's OK
-                }
 
-                TargetImpl target = (TargetImpl) module.getTarget();
-                ObjectName storeName = target.getObjectName();
-                kernel.invoke(storeName, "uninstall", new Object[]{configID}, UNINSTALL_SIG);
-                updateStatus("Uninstalled "+configID);
+                    TargetImpl target = (TargetImpl) module.getTarget();
+                    ObjectName storeName = target.getObjectName();
+                    kernel.invoke(storeName, "uninstall", new Object[]{configID}, UNINSTALL_SIG);
+                    updateStatus("Uninstalled "+configID);
 
-                doDeploy(deployer, module.getTarget(), false);
-                updateStatus("Deployed "+configID);
+                    doDeploy(deployer, module.getTarget(), false);
+                    updateStatus("Deployed "+configID);
 
-                List list = configurationManager.loadRecursive(configID);
-                for (int j = 0; j < list.size(); j++) {
-                    ObjectName name = (ObjectName) list.get(j);
-                    kernel.startRecursiveGBean(name);
-                    updateStatus("Started "+clean(name.getKeyProperty("name")));
+                    List list = configurationManager.loadRecursive(configID);
+                    for (int j = 0; j < list.size(); j++) {
+                        ObjectName name = (ObjectName) list.get(j);
+                        kernel.startRecursiveGBean(name);
+                        updateStatus("Started "+clean(name.getKeyProperty("name")));
+                    }
                 }
+            } finally {
+                ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
             }
             complete("Completed");
         } catch (Exception e) {

Modified: geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java?rev=231345&r1=231344&r2=231345&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java
(original)
+++ geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java
Wed Aug 10 15:40:39 2005
@@ -46,17 +46,21 @@
     public void run() {
         try {
             ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
-            for (int i = 0; i < modules.length; i++) {
-                TargetModuleID module = modules[i];
+            try {
+                for (int i = 0; i < modules.length; i++) {
+                    TargetModuleID module = modules[i];
 
-                URI moduleID = URI.create(module.getModuleID());
-                List list = configurationManager.loadRecursive(moduleID);
-                for (int j = 0; j < list.size(); j++) {
-                    ObjectName name = (ObjectName) list.get(j);
-                    kernel.startRecursiveGBean(name);
-                    String configName = ObjectName.unquote(name.getKeyProperty("name"));
-                    addModule(new TargetModuleIDImpl(modules[i].getTarget(), configName));
+                    URI moduleID = URI.create(module.getModuleID());
+                    List list = configurationManager.loadRecursive(moduleID);
+                    for (int j = 0; j < list.size(); j++) {
+                        ObjectName name = (ObjectName) list.get(j);
+                        kernel.startRecursiveGBean(name);
+                        String configName = ObjectName.unquote(name.getKeyProperty("name"));
+                        addModule(new TargetModuleIDImpl(modules[i].getTarget(), configName));
+                    }
                 }
+            } finally {
+                ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
             }
             complete("Completed");
         } catch (Exception e) {

Modified: geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StopCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StopCommand.java?rev=231345&r1=231344&r2=231345&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StopCommand.java
(original)
+++ geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StopCommand.java
Wed Aug 10 15:40:39 2005
@@ -48,24 +48,28 @@
     public void run() {
         try {
             ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
-            for (int i = 0; i < modules.length; i++) {
-                TargetModuleID module = modules[i];
+            try {
+                for (int i = 0; i < modules.length; i++) {
+                    TargetModuleID module = modules[i];
 
-                URI moduleID = URI.create(module.getModuleID());
-                ObjectName configName = Configuration.getConfigurationObjectName(moduleID);
-                try {
-                    kernel.stopGBean(configName);
-                } catch (GBeanNotFoundException e) {
-                    if(clean(e.getGBeanName().getKeyProperty("name")).equals(moduleID.toString()))
{
-                        updateStatus("Module "+moduleID+" is not running.");
-                        continue;
-                    } else {
-                        System.out.println("Unmatched name '"+clean(e.getGBeanName().getKeyProperty("name"))+"'");
-                        throw e;
+                    URI moduleID = URI.create(module.getModuleID());
+                    ObjectName configName = Configuration.getConfigurationObjectName(moduleID);
+                    try {
+                        kernel.stopGBean(configName);
+                    } catch (GBeanNotFoundException e) {
+                        if(clean(e.getGBeanName().getKeyProperty("name")).equals(moduleID.toString()))
{
+                            updateStatus("Module "+moduleID+" is not running.");
+                            continue;
+                        } else {
+                            System.out.println("Unmatched name '"+clean(e.getGBeanName().getKeyProperty("name"))+"'");
+                            throw e;
+                        }
                     }
+                    configurationManager.unload(moduleID);
+                    addModule(module);
                 }
-                configurationManager.unload(moduleID);
-                addModule(module);
+            } finally {
+                ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
             }
             if(getModuleCount() < modules.length) {
                 fail("Some modules could not be stopped");

Modified: geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java?rev=231345&r1=231344&r2=231345&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java
(original)
+++ geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java
Wed Aug 10 15:40:39 2005
@@ -49,40 +49,44 @@
     public void run() {
         try {
             ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
-            for (int i = 0; i < modules.length; i++) {
-                TargetModuleIDImpl module = (TargetModuleIDImpl) modules[i];
+            try {
+                for (int i = 0; i < modules.length; i++) {
+                    TargetModuleIDImpl module = (TargetModuleIDImpl) modules[i];
 
-                URI moduleID = URI.create(module.getModuleID());
-                try {
-                    ObjectName configName = Configuration.getConfigurationObjectName(moduleID);
+                    URI moduleID = URI.create(module.getModuleID());
                     try {
-                        kernel.stopGBean(configName);
-                        updateStatus("Module "+moduleID+" stopped.");
-                    } catch (GBeanNotFoundException e) {
-                        if(clean(e.getGBeanName().getKeyProperty("name")).equals(moduleID.toString()))
{
-                            // the module is not running
-                        } else {
-                            throw e;
+                        ObjectName configName = Configuration.getConfigurationObjectName(moduleID);
+                        try {
+                            kernel.stopGBean(configName);
+                            updateStatus("Module "+moduleID+" stopped.");
+                        } catch (GBeanNotFoundException e) {
+                            if(clean(e.getGBeanName().getKeyProperty("name")).equals(moduleID.toString()))
{
+                                // the module is not running
+                            } else {
+                                throw e;
+                            }
                         }
+                        configurationManager.unload(moduleID);
+                        updateStatus("Module "+moduleID+" unloaded.");
+                    } catch (InternalKernelException e) {
+                        // this is cause by the kernel being already shutdown
+                    } catch (NoSuchConfigException e) {
+                        // module was already undeployed - just continue
                     }
-                    configurationManager.unload(moduleID);
-                    updateStatus("Module "+moduleID+" unloaded.");
-                } catch (InternalKernelException e) {
-                    // this is cause by the kernel being already shutdown
-                } catch (NoSuchConfigException e) {
-                    // module was already undeployed - just continue
-                }
 
-                try {
-                    TargetImpl target = (TargetImpl) module.getTarget();
-                    ObjectName storeName = target.getObjectName();
-                    URI configID = URI.create(module.getModuleID());
-                    kernel.invoke(storeName, "uninstall", new Object[]{configID}, UNINSTALL_SIG);
-                    updateStatus("Module "+moduleID+" uninstalled.");
-                    addModule(module);
-                } catch (NoSuchConfigException e) {
-                    // module was already undeployed - just continue
+                    try {
+                        TargetImpl target = (TargetImpl) module.getTarget();
+                        ObjectName storeName = target.getObjectName();
+                        URI configID = URI.create(module.getModuleID());
+                        kernel.invoke(storeName, "uninstall", new Object[]{configID}, UNINSTALL_SIG);
+                        updateStatus("Module "+moduleID+" uninstalled.");
+                        addModule(module);
+                    } catch (NoSuchConfigException e) {
+                        // module was already undeployed - just continue
+                    }
                 }
+            } finally {
+                ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
             }
             if(getModuleCount() < modules.length) {
                 updateStatus("Some of the modules to undeploy were not previously deployed.
 This is not treated as an error.");

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java?rev=231345&r1=231344&r2=231345&view=diff
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
(original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
Wed Aug 10 15:40:39 2005
@@ -73,7 +73,7 @@
     private final ClassLoader parentCL;
 
     public DeploymentContext(File baseDir, URI configId, ConfigurationModuleType type, URI
parentID, Kernel kernel) throws MalformedObjectNameException, DeploymentException {
-        this(baseDir, configId,  type, parentID, null, null, kernel);
+        this(baseDir, configId, type, parentID, null, null, kernel);
     }
 
     public DeploymentContext(File baseDir, URI configId, ConfigurationModuleType type, URI
parentId, String domain, String server, Kernel kernel) throws MalformedObjectNameException,
DeploymentException {
@@ -104,6 +104,8 @@
                 loadedAncestors = configurationManager.loadRecursive(parentId);
             } catch (Exception e) {
                 throw new DeploymentException("Unable to load parents", e);
+            } finally {
+                ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
             }
 
             try {
@@ -480,8 +482,8 @@
     }
 
     /**
-     * @deprecated Currently used only in some tests, and may not be appropriate as a public
method.
      * @return a copy of the configurations GBeanData
+     * @deprecated Currently used only in some tests, and may not be appropriate as a public
method.
      */
     public GBeanData getConfigurationGBeanData() throws MalformedObjectNameException, InvalidConfigException
{
         URI id = configurationData.getId();
@@ -507,8 +509,8 @@
     }
 
     /**
-     * @deprecated REALLY deprecated.  Only use in tests, please.
      * @return
+     * @deprecated REALLY deprecated.  Only use in tests, please.
      */
     public GBeanData[] getGBeans() {
         return gbeans.getGBeans();

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java?rev=231345&r1=231344&r2=231345&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java
Wed Aug 10 15:40:39 2005
@@ -138,9 +138,9 @@
             return;
         }
 
-        ProxyMethodInterceptor methodInterceptor = (ProxyMethodInterceptor) interceptors.remove(proxy);
+        MethodInterceptor methodInterceptor = (MethodInterceptor) interceptors.remove(proxy);
         if (methodInterceptor != null) {
-            methodInterceptor.destroy();
+            doDestroy(methodInterceptor);
         }
     }
 
@@ -149,11 +149,11 @@
     }
 
     public synchronized ObjectName getProxyTarget(Object proxy) {
-        ProxyMethodInterceptor methodInterceptor = (ProxyMethodInterceptor) interceptors.get(proxy);
+        MethodInterceptor methodInterceptor = (MethodInterceptor) interceptors.get(proxy);
         if (methodInterceptor == null) {
             return null;
         }
-        return methodInterceptor.getObjectName();
+        return getObjectName(methodInterceptor);
     }
 
     private class ManagedProxyFactory implements ProxyFactory {
@@ -246,4 +246,13 @@
     protected Callback getMethodInterceptor(Class proxyType, Kernel kernel, ObjectName target)
{
         return new ProxyMethodInterceptor(proxyType, kernel, target);
     }
+
+    protected void doDestroy(MethodInterceptor methodInterceptor) {
+         ((ProxyMethodInterceptor)methodInterceptor).destroy();
+    }
+
+     protected ObjectName getObjectName(MethodInterceptor methodInterceptor) {
+        return ((ProxyMethodInterceptor)methodInterceptor).getObjectName();
+    }
+
 }

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java?rev=231345&r1=231344&r2=231345&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
Wed Aug 10 15:40:39 2005
@@ -56,4 +56,9 @@
         ObjectName configurationManagerName = (ObjectName) names.iterator().next();
         return (ConfigurationManager) kernel.getProxyManager().createProxy(configurationManagerName,
ConfigurationManager.class);
     }
+
+    public static void releaseConfigurationManager(Kernel kernel, ConfigurationManager configurationManager)
{
+        kernel.getProxyManager().destroyProxy(configurationManager);
+    }
+    
 }

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/JMXProxyManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/JMXProxyManager.java?rev=231345&r1=231344&r2=231345&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/JMXProxyManager.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/JMXProxyManager.java
Wed Aug 10 15:40:39 2005
@@ -17,7 +17,9 @@
 package org.apache.geronimo.kernel.jmx;
 
 import javax.management.ObjectName;
+
 import net.sf.cglib.proxy.Callback;
+import net.sf.cglib.proxy.MethodInterceptor;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.basic.BasicProxyManager;
 
@@ -35,4 +37,13 @@
     protected Callback getMethodInterceptor(Class proxyType, Kernel kernel, ObjectName target)
{
         return new JMXProxyMethodInterceptor(proxyType, kernel, target);
     }
+
+    protected void doDestroy(MethodInterceptor methodInterceptor) {
+         ((JMXProxyMethodInterceptor)methodInterceptor).destroy();
+    }
+
+    protected ObjectName getObjectName(MethodInterceptor methodInterceptor) {
+        return ((JMXProxyMethodInterceptor)methodInterceptor).getObjectName();
+    }
+
 }

Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java?rev=231345&r1=231344&r2=231345&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java
(original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java
Wed Aug 10 15:40:39 2005
@@ -121,13 +121,17 @@
 
         // load and start the configurations
         ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
-        for (Iterator i = configurations.iterator(); i.hasNext();) {
-            URI configID = (URI) i.next();
-            List list = configurationManager.loadRecursive(configID);
-            for (Iterator iterator = list.iterator(); iterator.hasNext();) {
-                ObjectName name = (ObjectName) iterator.next();
-                kernel.startRecursiveGBean(name);
+        try {
+            for (Iterator i = configurations.iterator(); i.hasNext();) {
+                URI configID = (URI) i.next();
+                List list = configurationManager.loadRecursive(configID);
+                for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+                    ObjectName name = (ObjectName) iterator.next();
+                    kernel.startRecursiveGBean(name);
+                }
             }
+        } finally {
+            ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
         }
     }
 

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=231345&r1=231344&r2=231345&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 Wed
Aug 10 15:40:39 2005
@@ -232,17 +232,21 @@
             // load the rest of the configurations
             try {
                 ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
-                for (Iterator i = configs.iterator(); i.hasNext();) {
-                    URI configID = (URI) i.next();
-                    monitor.configurationLoading(configID);
-                    List list = configurationManager.loadRecursive(configID);
-                    monitor.configurationLoaded(configID);
-                    monitor.configurationStarting(configID);
-                    for (Iterator iterator = list.iterator(); iterator.hasNext();) {
-                        ObjectName name = (ObjectName) iterator.next();
-                         kernel.startRecursiveGBean(name);
+                try {
+                    for (Iterator i = configs.iterator(); i.hasNext();) {
+                        URI configID = (URI) i.next();
+                        monitor.configurationLoading(configID);
+                        List list = configurationManager.loadRecursive(configID);
+                        monitor.configurationLoaded(configID);
+                        monitor.configurationStarting(configID);
+                        for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+                            ObjectName name = (ObjectName) iterator.next();
+                             kernel.startRecursiveGBean(name);
+                        }
+                        monitor.configurationStarted(configID);
                     }
-                    monitor.configurationStarted(configID);
+                } finally {
+                    ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
                 }
             } catch (Exception e) {
                 //Exception caught when starting configurations, starting kernel shutdown



Mime
View raw message