mirror of https://github.com/apache/activemq.git
Use a CopyOnWriteArrayList to ensure that traversals of the adapters list do not generate ConcurrentModificationException if a new adapter is added during that time.
This commit is contained in:
parent
8d4234345b
commit
2b17fd8050
|
@ -20,7 +20,13 @@ import java.io.File;
|
||||||
import java.io.FileFilter;
|
import java.io.FileFilter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.charset.Charset;
|
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;
|
import javax.transaction.xa.Xid;
|
||||||
|
|
||||||
|
@ -78,7 +84,7 @@ public class MultiKahaDBPersistenceAdapter extends LockableServiceSupport implem
|
||||||
final DelegateDestinationMap destinationMap = new DelegateDestinationMap();
|
final DelegateDestinationMap destinationMap = new DelegateDestinationMap();
|
||||||
|
|
||||||
BrokerService brokerService;
|
BrokerService brokerService;
|
||||||
List<PersistenceAdapter> adapters = new LinkedList<PersistenceAdapter>();
|
List<PersistenceAdapter> adapters = new CopyOnWriteArrayList<PersistenceAdapter>();
|
||||||
private File directory = new File(IOHelper.getDefaultDataDirectory() + File.separator + "mKahaDB");
|
private File directory = new File(IOHelper.getDefaultDataDirectory() + File.separator + "mKahaDB");
|
||||||
|
|
||||||
MultiKahaDBTransactionStore transactionStore = new MultiKahaDBTransactionStore(this);
|
MultiKahaDBTransactionStore transactionStore = new MultiKahaDBTransactionStore(this);
|
||||||
|
|
Loading…
Reference in New Issue