org.apache.derby.impl.store.raw.xact
Class ConcurrentTransactionMapFactory

java.lang.Object
  extended by org.apache.derby.impl.store.raw.xact.TransactionMapFactory
      extended by org.apache.derby.impl.store.raw.xact.ConcurrentTransactionMapFactory

 class ConcurrentTransactionMapFactory
extends TransactionMapFactory

A helper class that enables use of 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 Summary
ConcurrentTransactionMapFactory()
           
 
Method Summary
(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConcurrentTransactionMapFactory

ConcurrentTransactionMapFactory()
Method Detail

newMap

java.util.Map newMap()
Description copied from class: 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.

Overrides:
newMap in class TransactionMapFactory
Returns:
a thread-safe map instance

visitEntries

void visitEntries(java.util.Map map,
                  TransactionTable.EntryVisitor visitor)
Description copied from class: 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).

Overrides:
visitEntries in class TransactionMapFactory
Parameters:
map - the map that contains the
See Also:
TransactionTable.visitEntries(TransactionTable.EntryVisitor)

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.