Package org.infinispan.context
Interface InvocationContextFactory
-
public interface InvocationContextFactory
Factory forInvocationContext
objects.- Since:
- 7.0
- Author:
- Manik Surtani (manik AT infinispan DOT org), Mircea.Markus@jboss.com, Dan Berindei
-
-
Field Summary
Fields Modifier and Type Field Description static int
UNBOUNDED
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InvocationContext
createClearNonTxInvocationContext()
Will create anClearInvocationContext
with theAbstractInvocationContext.isOriginLocal()
returning true.InvocationContext
createInvocationContext(boolean isWrite, int keyCount)
If we are in a tx scope this will return anTxInvocationContext
.InvocationContext
createInvocationContext(Transaction tx, boolean implicitTransaction)
Creates an invocation contextorg.infinispan.context.impl.NonTxInvocationContext
createNonTxInvocationContext()
Will create anNonTxInvocationContext
with theAbstractInvocationContext.isOriginLocal()
returning true.InvocationContext
createRemoteInvocationContext(org.infinispan.remoting.transport.Address origin)
Returns anNonTxInvocationContext
whoseAbstractInvocationContext.isOriginLocal()
flag will be true.InvocationContext
createRemoteInvocationContextForCommand(org.infinispan.commands.VisitableCommand cacheCommand, org.infinispan.remoting.transport.Address origin)
AscreateRemoteInvocationContext(org.infinispan.remoting.transport.Address)
, but returning the flags to the context from the Command if any Flag was set.org.infinispan.context.impl.RemoteTxInvocationContext
createRemoteTxInvocationContext(org.infinispan.transaction.impl.RemoteTransaction tx, org.infinispan.remoting.transport.Address origin)
Returns anRemoteTxInvocationContext
.InvocationContext
createSingleKeyNonTxInvocationContext()
Will create anNonTxInvocationContext
with theAbstractInvocationContext.isOriginLocal()
returning true.org.infinispan.context.impl.LocalTxInvocationContext
createTxInvocationContext(org.infinispan.transaction.impl.LocalTransaction localTransaction)
Returns aLocalTxInvocationContext
.
-
-
-
Field Detail
-
UNBOUNDED
static final int UNBOUNDED
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.- See Also:
- Constant Field Values
-
-
Method Detail
-
createInvocationContext
InvocationContext createInvocationContext(boolean isWrite, int keyCount)
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(Transaction tx, boolean implicitTransaction)
Creates an invocation context
-
createNonTxInvocationContext
org.infinispan.context.impl.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
org.infinispan.context.impl.LocalTxInvocationContext createTxInvocationContext(org.infinispan.transaction.impl.LocalTransaction localTransaction)
Returns aLocalTxInvocationContext
.
-
createRemoteTxInvocationContext
org.infinispan.context.impl.RemoteTxInvocationContext createRemoteTxInvocationContext(org.infinispan.transaction.impl.RemoteTransaction tx, org.infinispan.remoting.transport.Address origin)
Returns anRemoteTxInvocationContext
.- Parameters:
tx
- remote transactionorigin
- the origin of the command, or null if local
-
createRemoteInvocationContext
InvocationContext createRemoteInvocationContext(org.infinispan.remoting.transport.Address origin)
Returns anNonTxInvocationContext
whoseAbstractInvocationContext.isOriginLocal()
flag will be true.- Parameters:
origin
- the origin of the command, or null if local
-
createRemoteInvocationContextForCommand
InvocationContext createRemoteInvocationContextForCommand(org.infinispan.commands.VisitableCommand cacheCommand, org.infinispan.remoting.transport.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
-
-