Package org.infinispan.context
Interface InvocationContextFactory
- All Known Implementing Classes:
AbstractInvocationContextFactory
,NonTransactionalInvocationContextFactory
,TransactionalInvocationContextFactory
public interface InvocationContextFactory
Factory for
InvocationContext
objects.- Since:
- 7.0
- Author:
- Manik Surtani (manik AT infinispan DOT org), Mircea.Markus@jboss.com, Dan Berindei
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
To be used when building InvocationContext withcreateInvocationContext(boolean, int)
as an indicator of the fact that the size of the keys to be accessed in the context is not known. -
Method Summary
Modifier and TypeMethodDescriptionWill create anClearInvocationContext
with theAbstractInvocationContext.isOriginLocal()
returning true.createInvocationContext
(boolean isWrite, int keyCount) If we are in a tx scope this will return anTxInvocationContext
.createInvocationContext
(jakarta.transaction.Transaction tx, boolean implicitTransaction) Creates an invocation contextWill create anNonTxInvocationContext
with theAbstractInvocationContext.isOriginLocal()
returning true.createRemoteInvocationContext
(Address origin) Returns anNonTxInvocationContext
whoseAbstractInvocationContext.isOriginLocal()
flag will be true.createRemoteInvocationContextForCommand
(VisitableCommand cacheCommand, Address origin) AscreateRemoteInvocationContext(org.infinispan.remoting.transport.Address)
, but returning the flags to the context from the Command if any Flag was set.createRemoteTxInvocationContext
(RemoteTransaction tx, Address origin) Returns anRemoteTxInvocationContext
.Will create anNonTxInvocationContext
with theAbstractInvocationContext.isOriginLocal()
returning true.createTxInvocationContext
(LocalTransaction localTransaction) Returns aLocalTxInvocationContext
.
-
Field Details
-
UNBOUNDED
static final int UNBOUNDEDTo be used when building InvocationContext withcreateInvocationContext(boolean, int)
as an indicator of the fact that the size of the keys to be accessed in the context is not known.- See Also:
-
-
Method Details
-
createInvocationContext
If we are in a tx scope this will return anTxInvocationContext
. Otherwise it will return anNonTxInvocationContext
. Either way, both context will be marked as local, i.e.InvocationContext.isOriginLocal()
will be true. -
createInvocationContext
InvocationContext createInvocationContext(jakarta.transaction.Transaction tx, boolean implicitTransaction) Creates an invocation context -
createNonTxInvocationContext
NonTxInvocationContext createNonTxInvocationContext()Will create anNonTxInvocationContext
with theAbstractInvocationContext.isOriginLocal()
returning true. -
createSingleKeyNonTxInvocationContext
InvocationContext createSingleKeyNonTxInvocationContext()Will create anNonTxInvocationContext
with theAbstractInvocationContext.isOriginLocal()
returning true. -
createClearNonTxInvocationContext
InvocationContext createClearNonTxInvocationContext()Will create anClearInvocationContext
with theAbstractInvocationContext.isOriginLocal()
returning true. -
createTxInvocationContext
Returns aLocalTxInvocationContext
. -
createRemoteTxInvocationContext
Returns anRemoteTxInvocationContext
.- Parameters:
tx
- remote transactionorigin
- the origin of the command, or null if local
-
createRemoteInvocationContext
Returns anNonTxInvocationContext
whoseAbstractInvocationContext.isOriginLocal()
flag will be true.- Parameters:
origin
- the origin of the command, or null if local
-
createRemoteInvocationContextForCommand
InvocationContext createRemoteInvocationContextForCommand(VisitableCommand cacheCommand, Address origin) AscreateRemoteInvocationContext(org.infinispan.remoting.transport.Address)
, but returning the flags to the context from the Command if any Flag was set.- Parameters:
cacheCommand
- the remote commandorigin
- the origin of the command, or null if local
-