org.jboss.cache.invocation
Class MVCCInvocationContext

java.lang.Object
  extended by org.jboss.cache.InvocationContext
      extended by org.jboss.cache.invocation.MVCCInvocationContext

public class MVCCInvocationContext
extends InvocationContext

An invocation context that is specific to MVCC locking

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

Field Summary
 
Fields inherited from class org.jboss.cache.InvocationContext
invocationLocks, transactionContext
 
Constructor Summary
MVCCInvocationContext()
           
 
Method Summary
 void clearLookedUpNodes()
          Clears the registry of looked up nodes.
 InvocationContext copy()
          This is a "copy-factory-method" that should be used whenever a clone of this class is needed.
 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)
          Adds a map of looked up nodes to the current map of looked up nodes
 void reset()
          Resets the context, freeing up any references.
 void setTransactionContext(TransactionContext transactionContext)
          Sets the transaction context to be associated with the current thread.
 
Methods inherited from class org.jboss.cache.InvocationContext
addAllLocks, addFqnLoaded, addLock, clearLocks, doCopy, equals, getCommand, getFqnsLoaded, getGlobalTransaction, getLockAcquisitionTimeout, getLocks, getMethodCall, getOptionOverrides, getTransaction, getTransactionContext, hashCode, hasLock, isLocalRollbackOnly, isLockingSuppressed, isOptionsUninitialised, isOriginLocal, isValidTransaction, removeLock, setCommand, setFqnsLoaded, setGlobalTransaction, setLocalRollbackOnly, setMethodCall, setOptionOverrides, setOriginLocal, setState, setTransaction, throwIfNeeded, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MVCCInvocationContext

public MVCCInvocationContext()
Method Detail

setTransactionContext

public void setTransactionContext(TransactionContext transactionContext)
Description copied from class: InvocationContext
Sets the transaction context to be associated with the current thread.

Overrides:
setTransactionContext in class InvocationContext
Parameters:
transactionContext - transaction context to set

lookUpNode

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

If a transaction is in progress, implementations should delegate to MVCCTransactionContext.lookUpNode(Fqn)

Specified by:
lookUpNode in class InvocationContext
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.

If a transaction is in progress, implementations should delegate to MVCCTransactionContext.putLookedUpNode(Fqn, NodeSPI)

Specified by:
putLookedUpNode in class InvocationContext
Parameters:
f - fqn to add
n - node to add

putLookedUpNodes

public void putLookedUpNodes(Map<Fqn,NodeSPI> lookedUpNodes)
Description copied from class: InvocationContext
Adds a map of looked up nodes to the current map of looked up nodes

Specified by:
putLookedUpNodes in class InvocationContext
Parameters:
lookedUpNodes - looked up nodes to add

clearLookedUpNodes

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

If a transaction is in progress, implementations should delegate to MVCCTransactionContext.clearLookedUpNodes().

Specified by:
clearLookedUpNodes in class InvocationContext

getLookedUpNodes

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

If a transaction is in progress, implementations should delegate to MVCCTransactionContext.getLookedUpNodes().

Specified by:
getLookedUpNodes in class InvocationContext
Returns:
a map of looked up nodes.

reset

public void reset()
Description copied from class: InvocationContext
Resets the context, freeing up any references.

Overrides:
reset in class InvocationContext

copy

public InvocationContext copy()
Description copied from class: InvocationContext
This is a "copy-factory-method" that should be used whenever a clone of this class is needed. The resulting instance is equal() to, but not ==, to the InvocationContext invoked on. Note that this is a shallow copy with the exception of the Option object, which is deep, as well as any collections held on the context such as locks. Note that the reference to a TransactionContext, if any, is maintained.

Specified by:
copy in class InvocationContext
Returns:
a new InvocationContext


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