camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1345499 - in /camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam: model/ProcessInstance.java rules/ProcessRules.java
Date Sat, 02 Jun 2012 12:13:57 GMT
Author: davsclaus
Date: Sat Jun  2 12:13:56 2012
New Revision: 1345499

URL: http://svn.apache.org/viewvc?rev=1345499&view=rev
Log:
CAMEL-5060: Fixed concurrency issue in camel-bam

Modified:
    camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ProcessInstance.java
    camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/rules/ProcessRules.java

Modified: camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ProcessInstance.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ProcessInstance.java?rev=1345499&r1=1345498&r2=1345499&view=diff
==============================================================================
--- camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ProcessInstance.java
(original)
+++ camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ProcessInstance.java
Sat Jun  2 12:13:56 2012
@@ -18,7 +18,7 @@ package org.apache.camel.bam.model;
 
 import java.util.Collection;
 import java.util.Date;
-import java.util.HashSet;
+import java.util.concurrent.CopyOnWriteArraySet;
 
 import javax.persistence.CascadeType;
 import javax.persistence.Entity;
@@ -42,7 +42,7 @@ import org.apache.camel.bam.rules.Activi
 @Table(name = "CAMEL_PROCESSINSTANCE")
 public class ProcessInstance {
     private ProcessDefinition processDefinition;
-    private Collection<ActivityState> activityStates = new HashSet<ActivityState>();
+    private Collection<ActivityState> activityStates = new CopyOnWriteArraySet<ActivityState>();
     private String correlationKey;
     private Date timeStarted;
     private Date timeCompleted;

Modified: camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/rules/ProcessRules.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/rules/ProcessRules.java?rev=1345499&r1=1345498&r2=1345499&view=diff
==============================================================================
--- camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/rules/ProcessRules.java
(original)
+++ camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/rules/ProcessRules.java
Sat Jun  2 12:13:56 2012
@@ -16,8 +16,8 @@
  */
 package org.apache.camel.bam.rules;
 
-import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.bam.model.ActivityState;
@@ -31,7 +31,7 @@ import org.apache.camel.util.ServiceHelp
  */
 public class ProcessRules extends ServiceSupport {
     private ProcessDefinition processDefinition;
-    private List<ActivityRules> activities = new ArrayList<ActivityRules>();
+    private List<ActivityRules> activities = new CopyOnWriteArrayList<ActivityRules>();
 
     public synchronized void processExpired(ActivityState activityState) throws Exception
{
         for (ActivityRules activityRules : activities) {



Mime
View raw message