Infinispan Distribution 5.2.6.Final-redhat-2

org.infinispan.context.impl
Interface TxInvocationContext

All Superinterfaces:
Cloneable, EntryLookup, InvocationContext
All Known Implementing Classes:
AbstractTxInvocationContext, LocalTxInvocationContext, RemoteTxInvocationContext

public interface TxInvocationContext
extends InvocationContext

Interface defining additional functionality for invocation contexts that propagate within a transaction's scope.

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

Method Summary
 void addAffectedKey(Object key)
           
 void addAllAffectedKeys(Collection<Object> keys)
          Registers a new participant with the transaction.
 Set<Object> getAffectedKeys()
          Returns the set of keys that are affected by this transaction.
 CacheTransaction getCacheTransaction()
           
 GlobalTransaction getGlobalTransaction()
          Returns the id of the transaction associated with the current call.
 List<WriteCommand> getModifications()
          Returns the modifications performed in the scope of the current transaction.
 Transaction getTransaction()
          Returns the tx associated with the current thread.
 boolean hasModifications()
          Checks if there are modifications performed within the tx's scope.
 boolean isImplicitTransaction()
           
 boolean isTransactionValid()
           
 void setImplicitTransaction(boolean implicit)
          Marks this transaction as implicit; implicit transactions are started for transactional caches that have the autoCommit enabled.
 
Methods inherited from interface org.infinispan.context.InvocationContext
addLockedKey, clearLockedKeys, clone, getClassLoader, getLockedKeys, getLockOwner, getOrigin, hasLockedKey, isInTxScope, isOriginLocal, isUseFutureReturnType, replaceValue, setClassLoader, setUseFutureReturnType
 
Methods inherited from interface org.infinispan.context.EntryLookup
clearLookedUpEntries, getLookedUpEntries, lookupEntry, putLookedUpEntries, putLookedUpEntry, removeLookedUpEntry
 

Method Detail

hasModifications

boolean hasModifications()
Checks if there are modifications performed within the tx's scope. Any modifications having Flag.CACHE_MODE_LOCAL are ignored.


getAffectedKeys

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


getGlobalTransaction

GlobalTransaction getGlobalTransaction()
Returns the id of the transaction associated with the current call.


getModifications

List<WriteCommand> getModifications()
Returns the modifications performed in the scope of the current transaction. Any modifications having Flag.CACHE_MODE_LOCAL are ignored. The returned list can be null.


getTransaction

Transaction getTransaction()
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.

Throws:
IllegalStateException - if the call is performed from a InvocationContext.isOriginLocal()==false context.

addAllAffectedKeys

void addAllAffectedKeys(Collection<Object> keys)
Registers a new participant with the transaction.


addAffectedKey

void addAffectedKey(Object key)

isTransactionValid

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

setImplicitTransaction

void setImplicitTransaction(boolean implicit)
Marks this transaction as implicit; implicit transactions are started for transactional caches that have the autoCommit enabled.


isImplicitTransaction

boolean isImplicitTransaction()

getCacheTransaction

CacheTransaction getCacheTransaction()

Infinispan Distribution 5.2.6.Final-redhat-2

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