activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-5580
Date Wed, 11 Feb 2015 22:22:34 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 8d4234345 -> 2b17fd805


https://issues.apache.org/jira/browse/AMQ-5580

Use a CopyOnWriteArrayList to ensure that traversals of the adapters
list do not generate ConcurrentModificationException if a new adapter is
added during that time.  

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/2b17fd80
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/2b17fd80
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/2b17fd80

Branch: refs/heads/master
Commit: 2b17fd805098e0c42821dacd5695db067ce594f6
Parents: 8d42343
Author: Timothy Bish <tabish121@gmail.com>
Authored: Wed Feb 11 17:22:26 2015 -0500
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Wed Feb 11 17:22:26 2015 -0500

----------------------------------------------------------------------
 .../store/kahadb/MultiKahaDBPersistenceAdapter.java       | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/2b17fd80/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MultiKahaDBPersistenceAdapter.java
----------------------------------------------------------------------
diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MultiKahaDBPersistenceAdapter.java
b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MultiKahaDBPersistenceAdapter.java
index f22e544..286931e 100644
--- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MultiKahaDBPersistenceAdapter.java
+++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MultiKahaDBPersistenceAdapter.java
@@ -20,7 +20,13 @@ import java.io.File;
 import java.io.FileFilter;
 import java.io.IOException;
 import java.nio.charset.Charset;
-import java.util.*;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 import javax.transaction.xa.Xid;
 
@@ -78,7 +84,7 @@ public class MultiKahaDBPersistenceAdapter extends LockableServiceSupport
implem
     final DelegateDestinationMap destinationMap = new DelegateDestinationMap();
 
     BrokerService brokerService;
-    List<PersistenceAdapter> adapters = new LinkedList<PersistenceAdapter>();
+    List<PersistenceAdapter> adapters = new CopyOnWriteArrayList<PersistenceAdapter>();
     private File directory = new File(IOHelper.getDefaultDataDirectory() + File.separator
+ "mKahaDB");
 
     MultiKahaDBTransactionStore transactionStore = new MultiKahaDBTransactionStore(this);


Mime
View raw message