class ConcurrentTransactionMapFactory extends TransactionMapFactory
ConcurrentHashMap
instead of
Hashtable
on platforms that support it. This class will be used if
we are running on a Java 1.5 or higher.Constructor and Description |
---|
ConcurrentTransactionMapFactory() |
Modifier and Type | Method and Description |
---|---|
(package private) java.util.Map |
newMap()
Create a new map instance.
|
(package private) void |
visitEntries(java.util.Map map,
TransactionTable.EntryVisitor visitor)
Traverse the values of a map, and apply the specified visitor on each
value.
|
java.util.Map newMap()
TransactionMapFactory
Create a new map instance. The map implementation must be thread-safe so that its instances can be accessed concurrently by multiple threads. That is, the map implemenation must guarantee that every method is atomic and does not fail or make the map become inconsistent just because it is accessed concurrently by another thread.
Callers should never synchronize on the returned object in order to get consistency/atomicity guarantees across multiple accesses to the map. Instead, they should use the helper methods defined in this class, so that a mechanism appropriate for this particular map implementation is used to ensure thread-safety.
newMap
in class TransactionMapFactory
void visitEntries(java.util.Map map, TransactionTable.EntryVisitor visitor)
TransactionMapFactory
Traverse the values of a map, and apply the specified visitor on each
value. The traversal should be thread-safe in the sense that it should
not fail because other threads access and potentially modify the map
while the traversal takes place, and it must also provide all the
thread-safety guarantees that are given by
TransactionTable.visitEntries(TransactionTable.EntryVisitor)
.
visitEntries
in class TransactionMapFactory
map
- the map that contains theTransactionTable.visitEntries(TransactionTable.EntryVisitor)
Apache Derby V10.10 Internals - Copyright © 2004,2013 The Apache Software Foundation. All Rights Reserved.