cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r524733 - /incubator/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/jmx/InstrumentationManagerImpl.java
Date Mon, 02 Apr 2007 06:38:47 GMT
Author: ningjiang
Date: Sun Apr  1 23:38:46 2007
New Revision: 524733

URL: http://svn.apache.org/viewvc?view=rev&rev=524733
Log:
Changed the InstrumentationManagerImpl to avoid avoid the CurrentModificationException when
bus shutdown

Modified:
    incubator/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/jmx/InstrumentationManagerImpl.java

Modified: incubator/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/jmx/InstrumentationManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/jmx/InstrumentationManagerImpl.java?view=diff&rev=524733&r1=524732&r2=524733
==============================================================================
--- incubator/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/jmx/InstrumentationManagerImpl.java
(original)
+++ incubator/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/jmx/InstrumentationManagerImpl.java
Sun Apr  1 23:38:46 2007
@@ -21,7 +21,6 @@
 
 import java.io.IOException;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 import java.util.logging.Level;
@@ -197,14 +196,15 @@
     public void preShutdown() {
                 
     }
-
+    
+   
     public void postShutdown() {
-        Iterator<ObjectName> it = busMBeans.iterator();
-        while (it.hasNext()) {
-            ObjectName name = it.next();
-            it.remove();
+        //Using the array to hold the busMBeans to avoid the CurrentModification exception
+        Object[] mBeans = busMBeans.toArray();
+        for (Object name : mBeans) {
+            busMBeans.remove((ObjectName)name);
             try {
-                unregister(name);
+                unregister((ObjectName)name);
             } catch (JMException jmex) {
                 LOG.log(Level.SEVERE, "UNREGISTER_FAILURE_MSG", new Object[]{name, jmex});
             }



Mime
View raw message