geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r1139260 - /geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
Date Fri, 24 Jun 2011 12:00:06 GMT
Author: genspring
Date: Fri Jun 24 12:00:05 2011
New Revision: 1139260

URL: http://svn.apache.org/viewvc?rev=1139260&view=rev
Log:
GERONIMO-6019 Make sure all the ejbs are removed while stopping the EJBModule, use iterator
to remove object to avoid ConcurrentModificationException.

Modified:
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java?rev=1139260&r1=1139259&r2=1139260&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
Fri Jun 24 12:00:05 2011
@@ -20,6 +20,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Hashtable;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -192,9 +193,14 @@ public class EjbModuleImpl implements EJ
     public void doStop() {
         try {
             openEjbSystem.removeApplication(appInfo, classLoader);
-            for (EjbDeployment ejb : ejbs.values()) {
-                removeEjb(ejb);
+            
+            Iterator<EjbDeployment> it= ejbs.values().iterator();
+            while(it.hasNext())
+            {
+                GeronimoThreadContextListener.get().removeEjb(it.next().getDeploymentId());
 
+                it.remove();
             }
+
         } catch (NoSuchApplicationException e) {
             log.error("Module does not exist.", e);
         } catch (UndeployException e) {



Mime
View raw message