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

java.lang.Object
  extended by org.apache.derby.impl.store.raw.xact.TransactionMapFactory
Direct Known Subclasses:
ConcurrentTransactionMapFactory

 class TransactionMapFactory
extends java.lang.Object

Helper class for TransactionTable which allows it to plug in a different java.util.Map implementation for the map that contains all the TransactionTableEntry instances in the transaction table. The default implementation of this class provides support for java.util.Hashtable.


Constructor Summary
TransactionMapFactory()
           
 
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

TransactionMapFactory

TransactionMapFactory()
Method Detail

newMap

java.util.Map newMap()

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.

Returns:
a thread-safe map instance

visitEntries

void visitEntries(java.util.Map map,
                  TransactionTable.EntryVisitor visitor)

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).

Parameters:
map - the map that contains the
visitor -
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.