camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1375938 - in /camel/branches/camel-2.9.x: ./ camel-core/src/main/java/org/apache/camel/management/DefaultManagementStrategy.java
Date Wed, 22 Aug 2012 08:21:17 GMT
Author: davsclaus
Date: Wed Aug 22 08:21:16 2012
New Revision: 1375938

URL: http://svn.apache.org/viewvc?rev=1375938&view=rev
Log:
allow eventNotifiers to be added asynchronously to a CamelContext while a context is starting
up to avoid the dreaded ConcurrentModificationException being thrown, fixes CAMEL-5531

Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/management/DefaultManagementStrategy.java

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1375936
  Merged /camel/branches/camel-2.10.x:r1375937

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/management/DefaultManagementStrategy.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/management/DefaultManagementStrategy.java?rev=1375938&r1=1375937&r2=1375938&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/management/DefaultManagementStrategy.java
(original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/management/DefaultManagementStrategy.java
Wed Aug 22 08:21:16 2012
@@ -16,9 +16,9 @@
  */
 package org.apache.camel.management;
 
-import java.util.ArrayList;
 import java.util.EventObject;
 import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.CamelContextAware;
@@ -50,7 +50,7 @@ import org.apache.camel.util.ServiceHelp
  */
 public class DefaultManagementStrategy implements ManagementStrategy, CamelContextAware {
 
-    private List<EventNotifier> eventNotifiers = new ArrayList<EventNotifier>();
+    private List<EventNotifier> eventNotifiers = new CopyOnWriteArrayList<EventNotifier>();
     private EventFactory eventFactory = new DefaultEventFactory();
     private ManagementNamingStrategy managementNamingStrategy;
     private ManagementObjectStrategy managementObjectStrategy;



Mime
View raw message