public interface InvocationContextContainer
InvocationContext
and the calling thread. Also acts
as a factory for creating various types of InvocationContext
s.Modifier and Type | Field and Description |
---|---|
static int |
UNBOUNDED
To be used when building InvocationContext with
createInvocationContext(boolean, int) as an indicator
of the fact that the size of the keys to be accessed in the context is not known. |
static final int UNBOUNDED
createInvocationContext(boolean, int)
as an indicator
of the fact that the size of the keys to be accessed in the context is not known.@Deprecated InvocationContext getInvocationContext(boolean quiet)
InvocationContext
that is currently associated with the calling thread. Important:
implementations of this method are most likely expensive, involving thread locals. It is recommended to cache
the result of this method rather than repeating the call.quiet
- IllegalStateException
- if there is no context associated with the current thread.InvocationContext createInvocationContext(boolean isWrite, int keyCount)
TxInvocationContext
. Otherwise it
will return an NonTxInvocationContext
. Either way, both context will be marked
as local, i.e. InvocationContext.isOriginLocal()
will be true.InvocationContext createInvocationContext(Transaction tx)
tx
- NonTxInvocationContext createNonTxInvocationContext()
NonTxInvocationContext
with the NonTxInvocationContext.isOriginLocal()
returning true.InvocationContext createSingleKeyNonTxInvocationContext()
NonTxInvocationContext
with the NonTxInvocationContext.isOriginLocal()
returning true.LocalTxInvocationContext createTxInvocationContext()
LocalTxInvocationContext
.RemoteTxInvocationContext createRemoteTxInvocationContext(RemoteTransaction tx, Address origin)
RemoteTxInvocationContext
.tx
- remote transactionorigin
- the origin of the command, or null if localInvocationContext createRemoteInvocationContext(Address origin)
NonTxInvocationContext
whose NonTxInvocationContext.isOriginLocal()
flag will be true.origin
- the origin of the command, or null if localInvocationContext createRemoteInvocationContextForCommand(VisitableCommand cacheCommand, Address origin)
createRemoteInvocationContext(org.infinispan.remoting.transport.Address)
, but returning the flags to
the context from the Command if any Flag was set.cacheCommand
- origin
- the origin of the command, or null if localvoid clearThreadLocal()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.