activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject [6/6] activemq git commit: https://issues.apache.org/jira/browse/AMQ-5580
Date Thu, 12 Feb 2015 23:22:25 GMT
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/e5c5a821
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/e5c5a821
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/e5c5a821

Branch: refs/heads/activemq-5.11.x
Commit: e5c5a821c7f7a651a37fe97a65181401eb7cfb1e
Parents: bd1226b
Author: Timothy Bish <tabish121@gmail.com>
Authored: Wed Feb 11 17:22:26 2015 -0500
Committer: Hadrian Zbarcea <hadrian@apache.org>
Committed: Thu Feb 12 18:22:10 2015 -0500

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


http://git-wip-us.apache.org/repos/asf/activemq/blob/e5c5a821/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