org.infinispan.context.impl
Interface TxInvocationContext

All Superinterfaces:
Cloneable, EntryLookup, FlagContainer, 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 addTransactionParticipants(List<Address> addresses)
          Registers a new participant with the 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.
 Set<Address> getTransactionParticipants()
          Returns the set of cluster participants (identified through Address objects) that participate within the transaction.
 boolean hasModifications()
          Were there any modifications performed within the tx's scope?
 boolean isValidRunningTx()
          Returns true if the current tx is either ACTIVE or PREPARING, false otherwise.
 
Methods inherited from interface org.infinispan.context.InvocationContext
clone, 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
 

Method Detail

hasModifications

boolean hasModifications()
Were there any modifications performed within the tx's scope?


getTransactionParticipants

Set<Address> getTransactionParticipants()
Returns the set of cluster participants (identified through Address objects) that participate within the transaction. Null indicates all cluster members.


getGlobalTransaction

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


getModifications

List<WriteCommand> getModifications()
Returns all the modifications performed in the scope of the current transaction.


getRunningTransaction

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

isValidRunningTx

boolean isValidRunningTx()
Returns true if the current tx is either ACTIVE or PREPARING, false otherwise.


addTransactionParticipants

void addTransactionParticipants(List<Address> addresses)
Registers a new participant with the transaction.


Google Analytics

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