org.infinispan.context
Interface InvocationContext

All Superinterfaces:
Cloneable, EntryLookup, FlagContainer
All Known Subinterfaces:
TxInvocationContext
All Known Implementing Classes:
AbstractInvocationContext, AbstractTxInvocationContext, ImmutableContext, InvocationContextFlagsOverride, LocalTxInvocationContext, NonTxInvocationContext, RemoteTxInvocationContext, SingleKeyNonTxInvocationContext, TransactionalInvocationContextFlagsOverride

public interface InvocationContext
extends EntryLookup, FlagContainer, Cloneable

A context that contains information pertaining to a given invocation. These contexts typically have the lifespan of a single invocation.

Since:
4.0
Author:
Manik Surtani (manik@jboss.org), Mircea.Markus@jboss.com

Method Summary
 void addLockedKey(Object key)
          Tracks the given key as locked by this invocation context.
 void clearLockedKeys()
           
 InvocationContext clone()
          Clones the invocation context.
 ClassLoader getClassLoader()
          Returns the class loader associated with this invocation
 Set<Object> getLockedKeys()
          Returns the set of keys that are locked for writing.
 Object getLockOwner()
          Returns the in behalf of which locks will be aquired.
 Address getOrigin()
          Get the origin of the command, or null if the command originated locally
 boolean hasLockedKey(Object key)
          Returns true if the lock being tested is already held in the current scope, false otherwise.
 boolean isInTxScope()
          Returns true if this call is performed in the context of an transaction, false otherwise.
 boolean isOriginLocal()
          Returns true if the call was originated locally, false if it is the result of a remote rpc.
 boolean isUseFutureReturnType()
          Indicates whether the call requires a Future as return type.
 void setClassLoader(ClassLoader classLoader)
          Sets the class loader associated for this invocation
 void setUseFutureReturnType(boolean useFutureReturnType)
          Sets whether the call requires a Future as return type.
 
Methods inherited from interface org.infinispan.context.EntryLookup
clearLookedUpEntries, getLookedUpEntries, lookupEntry, putLookedUpEntries, putLookedUpEntry, removeLookedUpEntry
 
Methods inherited from interface org.infinispan.context.FlagContainer
getFlags, hasFlag, reset, setFlags, setFlags
 

Method Detail

isOriginLocal

boolean isOriginLocal()
Returns true if the call was originated locally, false if it is the result of a remote rpc.


getOrigin

Address getOrigin()
Get the origin of the command, or null if the command originated locally

Returns:

isInTxScope

boolean isInTxScope()
Returns true if this call is performed in the context of an transaction, false otherwise.


getLockOwner

Object getLockOwner()
Returns the in behalf of which locks will be aquired.


isUseFutureReturnType

boolean isUseFutureReturnType()
Indicates whether the call requires a Future as return type.

Returns:
true if the call requires a Future as return type, false otherwise

setUseFutureReturnType

void setUseFutureReturnType(boolean useFutureReturnType)
Sets whether the call requires a Future as return type.

Parameters:
useFutureReturnType - boolean indicating whether a Future will be needed.

clone

InvocationContext clone()
Clones the invocation context.

Returns:
A cloned instance of this invocation context instance

getLockedKeys

Set<Object> getLockedKeys()
Returns the set of keys that are locked for writing.


clearLockedKeys

void clearLockedKeys()

getClassLoader

ClassLoader getClassLoader()
Returns the class loader associated with this invocation

Returns:
a class loader instance or null if no class loader was specifically associated

setClassLoader

void setClassLoader(ClassLoader classLoader)
Sets the class loader associated for this invocation

Parameters:
classLoader -

addLockedKey

void addLockedKey(Object key)
Tracks the given key as locked by this invocation context.


hasLockedKey

boolean hasLockedKey(Object key)
Returns true if the lock being tested is already held in the current scope, false otherwise.

Parameters:
key - lock to test

-->

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