geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r903521 - in /geronimo/server/branches/2.2/plugins/clustering/geronimo-deploy-farm: ./ src/main/java/org/apache/geronimo/farm/deployment/ src/test/java/org/apache/geronimo/farm/deployment/
Date Wed, 27 Jan 2010 01:52:31 GMT
Author: djencks
Date: Wed Jan 27 01:52:30 2010
New Revision: 903521

URL: http://svn.apache.org/viewvc?rev=903521&view=rev
Log:
GERONIMO-4844 Fix uninstall in a cluster.  Thanks to Ashish Jain for the original patch, the
test also needed tweaking. port from 2.1

Modified:
    geronimo/server/branches/2.2/plugins/clustering/geronimo-deploy-farm/   (props changed)
    geronimo/server/branches/2.2/plugins/clustering/geronimo-deploy-farm/src/main/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClient.java
    geronimo/server/branches/2.2/plugins/clustering/geronimo-deploy-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClientTest.java

Propchange: geronimo/server/branches/2.2/plugins/clustering/geronimo-deploy-farm/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Jan 27 01:52:30 2010
@@ -0,0 +1 @@
+/geronimo/server/branches/2.1/plugins/clustering/geronimo-farm:903520

Modified: geronimo/server/branches/2.2/plugins/clustering/geronimo-deploy-farm/src/main/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClient.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/clustering/geronimo-deploy-farm/src/main/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClient.java?rev=903521&r1=903520&r2=903521&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/clustering/geronimo-deploy-farm/src/main/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClient.java
(original)
+++ geronimo/server/branches/2.2/plugins/clustering/geronimo-deploy-farm/src/main/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClient.java
Wed Jan 27 01:52:30 2010
@@ -39,6 +39,8 @@
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.repository.Artifact;
 
@@ -128,12 +130,11 @@
 
     protected void uninstall(NodeInfo nodeInfo, Artifact configId) throws IOException {
         Kernel kernel = nodeInfo.newKernel();
-        
-        AbstractName clusterConfigurationStoreName = searchClusterConfigurationStore(kernel);
-        
-        Object[] params = new Object[] {configId};
         try {
-            kernel.invoke(clusterConfigurationStoreName, "uninstall", params, METHOD_SIGNATURE_UNINSTALL);
+        	ConfigurationManager configurationManager = (ConfigurationManager) kernel.getGBean(ConfigurationManager.class);
+            configurationManager.stopConfiguration(configId);
+            configurationManager.unloadConfiguration(configId);
+            configurationManager.uninstallConfiguration(configId);
         } catch (Exception e) {
             throw (IOException) new IOException("See nested").initCause(e);
         }

Modified: geronimo/server/branches/2.2/plugins/clustering/geronimo-deploy-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClientTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/clustering/geronimo-deploy-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClientTest.java?rev=903521&r1=903520&r2=903521&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/clustering/geronimo-deploy-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClientTest.java
(original)
+++ geronimo/server/branches/2.2/plugins/clustering/geronimo-deploy-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClientTest.java
Wed Jan 27 01:52:30 2010
@@ -40,6 +40,7 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.NoSuchOperationException;
 import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Environment;
 
@@ -66,6 +67,7 @@
     private AbstractNameQuery clusterConfigurationStoreNameQuery;
     private Artifact configId;
     private ConfigurationData configurationData;
+    private ConfigurationManager configurationManager;
 
     @Override
     protected void setUp() throws Exception {
@@ -73,7 +75,7 @@
         configurationData = new ConfigurationData(new Environment(configId), new Jsr77Naming());
         File configurationDir = new File("configurationDir");
         configurationData.setConfigurationDir(configurationDir);
-
+        configurationManager = (ConfigurationManager) mock(ConfigurationManager.class);
         clusterInfo = (ClusterInfo) mock(ClusterInfo.class);
 
         Collection<NodeInfo> nodeInfos = new ArrayList<NodeInfo>();
@@ -228,11 +230,11 @@
     private void recordUninstall(Kernel kernel) throws GBeanNotFoundException, NoSuchOperationException,
Exception {
         AbstractName storeName = new AbstractName(configId, Collections.singletonMap("name",
"Store"));
         Set<AbstractName> storeNames = Collections.singleton(storeName);
-
-        kernel.listGBeans(clusterConfigurationStoreNameQuery);
-        modify().returnValue(storeNames);
-        
-        kernel.invoke(storeName, "uninstall", new Object[] {configId}, new String[] {Artifact.class.getName()});
+        kernel.getGBean(ConfigurationManager.class);
+        modify().returnValue(configurationManager);
+        configurationManager.stopConfiguration(configId);
+        configurationManager.unloadConfiguration(configId);
+        configurationManager.uninstallConfiguration(configId);
     }
     
     private void recordInstall(Kernel kernel, File packedDir) throws Exception {



Mime
View raw message