org.infinispan.context
Class TransactionalInvocationContextFlagsOverride

java.lang.Object
  extended by org.infinispan.context.InvocationContextFlagsOverride
      extended by org.infinispan.context.TransactionalInvocationContextFlagsOverride
All Implemented Interfaces:
Cloneable, EntryLookup, FlagContainer, TxInvocationContext, InvocationContext

public class TransactionalInvocationContextFlagsOverride
extends InvocationContextFlagsOverride
implements TxInvocationContext

Extension of InvocationContextFlagsOverride to be used when a TxInvocationContext is required.

Since:
5.0
Author:
Sanne Grinovero (C) 2011 Red Hat Inc.
See Also:
InvocationContextFlagsOverride

Constructor Summary
TransactionalInvocationContextFlagsOverride(TxInvocationContext delegate, Set<Flag> flags)
           
 
Method Summary
 void addAffectedKeys(Collection<Object> keys)
          Registers a new participant with the transaction.
 Set<Object> getAffectedKeys()
          Returns the set of keys that are affected by this transaction.
 GlobalTransaction getGlobalTransaction()
          Returns the id of the transaction assoctiated with the current call.
 List<WriteCommand> getModifications()
          Returns all the modifications performed in the scope of the current transaction.
 Transaction getRunningTransaction()
          Returns the tx associated with the current thread.
 boolean hasModifications()
          Were there any modifications performed within the tx's scope?
 boolean isRunningTransactionValid()
           
 
Methods inherited from class org.infinispan.context.InvocationContextFlagsOverride
clearLookedUpEntries, clone, getFlags, getLockedKeys, getLockOwner, getLookedUpEntries, hasFlag, hasLockedKey, isInTxScope, isOriginLocal, isUseFutureReturnType, lookupEntry, putLookedUpEntries, putLookedUpEntry, removeLookedUpEntry, reset, setFlags, setFlags, setUseFutureReturnType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.infinispan.context.InvocationContext
clone, getLockedKeys, getLockOwner, isInTxScope, isOriginLocal, isUseFutureReturnType, setUseFutureReturnType
 
Methods inherited from interface org.infinispan.context.EntryLookup
clearLookedUpEntries, getLookedUpEntries, hasLockedKey, lookupEntry, putLookedUpEntries, putLookedUpEntry, removeLookedUpEntry
 
Methods inherited from interface org.infinispan.context.FlagContainer
getFlags, hasFlag, reset, setFlags, setFlags
 

Constructor Detail

TransactionalInvocationContextFlagsOverride

public TransactionalInvocationContextFlagsOverride(TxInvocationContext delegate,
                                                   Set<Flag> flags)
Method Detail

hasModifications

public boolean hasModifications()
Description copied from interface: TxInvocationContext
Were there any modifications performed within the tx's scope?

Specified by:
hasModifications in interface TxInvocationContext

getAffectedKeys

public Set<Object> getAffectedKeys()
Description copied from interface: TxInvocationContext
Returns the set of keys that are affected by this transaction. Used to generate appropriate recipient groups for cluster-wide prepare and commit calls.

Specified by:
getAffectedKeys in interface TxInvocationContext

getGlobalTransaction

public GlobalTransaction getGlobalTransaction()
Description copied from interface: TxInvocationContext
Returns the id of the transaction assoctiated with the current call.

Specified by:
getGlobalTransaction in interface TxInvocationContext

getModifications

public List<WriteCommand> getModifications()
Description copied from interface: TxInvocationContext
Returns all the modifications performed in the scope of the current transaction.

Specified by:
getModifications in interface TxInvocationContext

getRunningTransaction

public Transaction getRunningTransaction()
Description copied from interface: TxInvocationContext
Returns the tx associated with the current thread. This method MUST be guarded with a call to InvocationContext.isOriginLocal(), as Transaction are not propagated from the node where tx was started.

Specified by:
getRunningTransaction in interface TxInvocationContext

addAffectedKeys

public void addAffectedKeys(Collection<Object> keys)
Description copied from interface: TxInvocationContext
Registers a new participant with the transaction.

Specified by:
addAffectedKeys in interface TxInvocationContext

isRunningTransactionValid

public boolean isRunningTransactionValid()
Specified by:
isRunningTransactionValid in interface TxInvocationContext
Returns:
true if the current transaction is in a valid state to perform operations on (i.e.,RUNNING or PREPARING) or false otherwise.


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