org.jboss.cache.transaction
Class MVCCTransactionContext

java.lang.Object
  extended by org.jboss.cache.transaction.AbstractTransactionContext
      extended by org.jboss.cache.transaction.MVCCTransactionContext
All Implemented Interfaces:
TransactionContext

public class MVCCTransactionContext
extends AbstractTransactionContext

A transaction context specially geared to dealing with MVCC.

Since:
3.0
Author:
Manik Surtani (manik AT jboss DOT org)

Constructor Summary
MVCCTransactionContext(Transaction tx)
           
 
Method Summary
 void clearLookedUpNodes()
          Clears the registry of looked up nodes.
 Map<Fqn,NodeSPI> getLookedUpNodes()
          Retrieves a map of nodes looked up within the current invocation's scope.
 NodeSPI lookUpNode(Fqn fqn)
          Retrieves a node from the registry of looked up nodes in the current scope.
 void putLookedUpNode(Fqn f, NodeSPI n)
          Puts an entry in the registry of looked up nodes in the current scope.
 void putLookedUpNodes(Map<Fqn,NodeSPI> lookedUpNodes)
           
 void reset()
          Cleans up internal state, freeing up references.
 
Methods inherited from class org.jboss.cache.transaction.AbstractTransactionContext
addAllLocks, addDummyNodeCreatedByCacheLoader, addLocalModification, addLock, addModification, addRemovedNode, clearLocks, getDummyNodesCreatedByCacheLoader, getLocalModifications, getLocks, getModifications, getOption, getOrderedSynchronizationHandler, getRemovedNodes, getTransaction, hasAnyModifications, hasLocalModifications, hasLock, hasModifications, isForceAsyncReplication, isForceSyncReplication, removeLock, setForceAsyncReplication, setForceSyncReplication, setOption, setOrderedSynchronizationHandler, setTransaction, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MVCCTransactionContext

public MVCCTransactionContext(Transaction tx)
                       throws SystemException,
                              RollbackException
Throws:
SystemException
RollbackException
Method Detail

lookUpNode

public NodeSPI lookUpNode(Fqn fqn)
Retrieves a node from the registry of looked up nodes in the current scope.

This is not normally called directly since InvocationContext.lookUpNode(org.jboss.cache.Fqn) would delegate to this method if a transaction is in scope.

Parameters:
fqn - fqn to look up
Returns:
a node, or null if it cannot be found.

putLookedUpNode

public void putLookedUpNode(Fqn f,
                            NodeSPI n)
Puts an entry in the registry of looked up nodes in the current scope.

This is not normally called directly since InvocationContext.putLookedUpNode(org.jboss.cache.Fqn, org.jboss.cache.NodeSPI) would delegate to this method if a transaction is in scope.

Parameters:
f - fqn to add
n - node to add

clearLookedUpNodes

public void clearLookedUpNodes()
Clears the registry of looked up nodes.

This is not normally called directly since InvocationContext.clearLookedUpNodes() would delegate to this method if a transaction is in scope.


getLookedUpNodes

public Map<Fqn,NodeSPI> getLookedUpNodes()
Retrieves a map of nodes looked up within the current invocation's scope.

This is not normally called directly since InvocationContext.getLookedUpNodes() would delegate to this method if a transaction is in scope.

Returns:
a map of looked up nodes.

reset

public void reset()
Description copied from interface: TransactionContext
Cleans up internal state, freeing up references.

Specified by:
reset in interface TransactionContext
Overrides:
reset in class AbstractTransactionContext

putLookedUpNodes

public void putLookedUpNodes(Map<Fqn,NodeSPI> lookedUpNodes)


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.