org.infinispan.context.impl
Class AbstractTxInvocationContext

java.lang.Object
  extended by org.infinispan.context.impl.AbstractInvocationContext
      extended by org.infinispan.context.impl.AbstractTxInvocationContext
All Implemented Interfaces:
Cloneable, EntryLookup, FlagContainer, TxInvocationContext, InvocationContext
Direct Known Subclasses:
LocalTxInvocationContext, RemoteTxInvocationContext

public abstract class AbstractTxInvocationContext
extends AbstractInvocationContext
implements TxInvocationContext

Support class for TxInvocationContext.

Since:
4.0
Author:
Mircea.Markus@jboss.com

Nested Class Summary
 
Nested classes/interfaces inherited from class org.infinispan.context.impl.AbstractInvocationContext
AbstractInvocationContext.ContextFlag
 
Field Summary
protected  Set<Object> affectedKeys
           
 
Fields inherited from class org.infinispan.context.impl.AbstractInvocationContext
contextFlags, flags
 
Constructor Summary
AbstractTxInvocationContext()
           
 
Method Summary
 void addAffectedKeys(Object... keys)
          Registers a new participant with the transaction.
static void assertTransactionValid(TxInvocationContext ctx)
          Tests whether the caller is in a valid transaction.
 AbstractTxInvocationContext clone()
           
 Set<Object> getAffectedKeys()
          Returns the set of keys that are affected by this transaction.
 boolean hasModifications()
          Were there any modifications performed within the tx's scope?
static boolean isActive(Transaction tx)
          Returns true if transaction is ACTIVE, false otherwise
static boolean isPreparing(Transaction tx)
          Returns true if transaction is PREPARING, false otherwise
static boolean isValid(Transaction tx)
          Return s true of tx's status is ACTIVE or PREPARING
 boolean isValidRunningTx()
          Returns true if the current tx is either ACTIVE or PREPARING, false otherwise.
 
Methods inherited from class org.infinispan.context.impl.AbstractInvocationContext
getFlags, hasFlag, hasLockedEntries, hasLockedKey, isContextFlagSet, isFlagsUninitialized, isUseFutureReturnType, reset, setContextFlag, setContextFlag, setFlags, setFlags, setUseFutureReturnType, toString, unsetContextFlag
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.infinispan.context.impl.TxInvocationContext
getGlobalTransaction, getModifications, getRunningTransaction
 
Methods inherited from interface org.infinispan.context.InvocationContext
getLockOwner, hasLockedEntries, 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, isFlagsUninitialized, reset, setFlags, setFlags
 

Field Detail

affectedKeys

protected Set<Object> affectedKeys
Constructor Detail

AbstractTxInvocationContext

public AbstractTxInvocationContext()
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

isValidRunningTx

public boolean isValidRunningTx()
Description copied from interface: TxInvocationContext
Returns true if the current tx is either ACTIVE or PREPARING, false otherwise.

Specified by:
isValidRunningTx in interface TxInvocationContext

addAffectedKeys

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

Specified by:
addAffectedKeys in interface TxInvocationContext

isValid

public static boolean isValid(Transaction tx)
Return s true of tx's status is ACTIVE or PREPARING

Parameters:
tx -
Returns:
true if the tx is active or preparing

isActive

public static boolean isActive(Transaction tx)
Returns true if transaction is ACTIVE, false otherwise


isPreparing

public static boolean isPreparing(Transaction tx)
Returns true if transaction is PREPARING, false otherwise


assertTransactionValid

public static void assertTransactionValid(TxInvocationContext ctx)
Tests whether the caller is in a valid transaction. If not, will throw a CacheException.


clone

public AbstractTxInvocationContext clone()
Specified by:
clone in interface InvocationContext
Overrides:
clone in class AbstractInvocationContext

Google Analytics

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