[jboss-cvs] JBoss Messaging SVN: r6594 - trunk/src/main/org/jboss/messaging/core/deployers/impl.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Apr 28 05:45:52 EDT 2009


Author: ataylor
Date: 2009-04-28 05:45:52 -0400 (Tue, 28 Apr 2009)
New Revision: 6594

Modified:
   trunk/src/main/org/jboss/messaging/core/deployers/impl/FileDeploymentManager.java
   trunk/src/main/org/jboss/messaging/core/deployers/impl/XmlDeployer.java
Log:
fixed undeploy for empty config files

Modified: trunk/src/main/org/jboss/messaging/core/deployers/impl/FileDeploymentManager.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/deployers/impl/FileDeploymentManager.java	2009-04-28 07:47:06 UTC (rev 6593)
+++ trunk/src/main/org/jboss/messaging/core/deployers/impl/FileDeploymentManager.java	2009-04-28 09:45:52 UTC (rev 6594)
@@ -22,6 +22,11 @@
 
 package org.jboss.messaging.core.deployers.impl;
 
+import org.jboss.messaging.core.deployers.Deployer;
+import org.jboss.messaging.core.deployers.DeploymentManager;
+import org.jboss.messaging.core.logging.Logger;
+import org.jboss.messaging.utils.Pair;
+
 import java.io.File;
 import java.net.URL;
 import java.util.ArrayList;
@@ -34,11 +39,6 @@
 import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.TimeUnit;
 
-import org.jboss.messaging.core.deployers.Deployer;
-import org.jboss.messaging.core.deployers.DeploymentManager;
-import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.utils.Pair;
-
 /**
  * @author <a href="ataylor at redhat.com">Andy Taylor</a>
  * @author <a href="tim.fox at jboss.com">Tim Fox</a>
@@ -229,7 +229,7 @@
                }
             }
          }
-
+         List<Pair> toRemove = new ArrayList<Pair>();
          for (Map.Entry<Pair<URL, Deployer>, DeployInfo> entry : deployed.entrySet())
          {
             Pair<URL, Deployer> pair = entry.getKey();
@@ -241,8 +241,7 @@
                   Deployer deployer = entry.getValue().deployer;
                   log.debug("Undeploying " + deployer + " with url" + entry.getKey());
                   deployer.undeploy(entry.getKey().a);
-
-                  deployed.remove(entry.getKey());
+                  toRemove.add(entry.getKey());
                }
                catch (Exception e)
                {
@@ -250,6 +249,10 @@
                }
             }
          }
+         for (Pair pair : toRemove)
+         {
+            deployed.remove(pair);  
+         }
       }
       catch (Exception e)
       {

Modified: trunk/src/main/org/jboss/messaging/core/deployers/impl/XmlDeployer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/deployers/impl/XmlDeployer.java	2009-04-28 07:47:06 UTC (rev 6593)
+++ trunk/src/main/org/jboss/messaging/core/deployers/impl/XmlDeployer.java	2009-04-28 09:45:52 UTC (rev 6594)
@@ -162,6 +162,13 @@
       Element e = getRootElement(url);
       
       validate(e);
+
+      Map<String, Node> map = configuration.get(url);
+      if (map == null)
+      {
+         map = new HashMap<String, Node>();
+         configuration.put(url, map);
+      }
       
       //find all thenodes to deploy
       String elements[] = getElementTagName();




More information about the jboss-cvs-commits mailing list