geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r344397 - in /geronimo/trunk/modules: deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/ kernel/src/java/org/apache/geronimo/kernel/config/
Date Tue, 15 Nov 2005 17:20:26 GMT
Author: ammulder
Date: Tue Nov 15 09:20:18 2005
New Revision: 344397

URL: http://svn.apache.org/viewcvs?rev=344397&view=rev
Log:
Fix undeploy for JSR-88 interface (GERONIMO-1132)

Modified:
    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/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java

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=344397&r1=344396&r2=344397&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
Tue Nov 15 09:20:18 2005
@@ -52,21 +52,12 @@
             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);
                         configurationManager.stop(moduleID);
-//                    } catch (GBeanNotFoundException e) {
                     } catch (InvalidConfigException 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;
-//                        }
+                        updateStatus("Module "+moduleID+" is not running.");
+                        continue;
                     }
                     configurationManager.unload(moduleID);
                     addModule(module);

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=344397&r1=344396&r2=344397&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
Tue Nov 15 09:20:18 2005
@@ -28,6 +28,7 @@
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.InternalKernelException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
@@ -55,15 +56,16 @@
 
                     URI moduleID = URI.create(module.getModuleID());
                     try {
-                        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.stop(moduleID);
+                        } catch (InvalidConfigException e) {
+                            if(e.getCause() instanceof GBeanNotFoundException) {
+                                GBeanNotFoundException gnf = (GBeanNotFoundException) e.getCause();
+                                if(clean(gnf.getGBeanName().getKeyProperty("name")).equals(moduleID.toString()))
{
+                                    // the module is not running
+                                } else {
+                                    throw gnf;
+                                }
                             }
                         }
                         configurationManager.unload(moduleID);
@@ -88,6 +90,7 @@
             } finally {
                 ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
             }
+            //todo: this will probably never happen because the command line args are compared
to actual modules
             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/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java?rev=344397&r1=344396&r2=344397&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java
Tue Nov 15 09:20:18 2005
@@ -23,6 +23,8 @@
 import javax.management.ObjectName;
 
 /**
+ *
+ *
  * @version $Rev$ $Date$
  */
 public interface ConfigurationManager {
@@ -73,7 +75,7 @@
 
     /**
      * Unloads the gbeans of the specified configuration, stops the configuration gbean,
and unloads the
-     * configuration gbean from the kernel.
+     * configuration gbean from the kernel.  Stop should always be called first.
      *
      * @param configID the name fo the configuration to remove
      * @throws NoSuchConfigException if the configuration is now loaded into the kernel



Mime
View raw message