Package org.infinispan.interceptors.impl
Class EntryWrappingInterceptor
- java.lang.Object
-
- org.infinispan.interceptors.BaseAsyncInterceptor
-
- org.infinispan.interceptors.DDAsyncInterceptor
-
- org.infinispan.interceptors.impl.EntryWrappingInterceptor
-
- All Implemented Interfaces:
Visitor
,AsyncInterceptor
- Direct Known Subclasses:
RetryingEntryWrappingInterceptor
,VersionedEntryWrappingInterceptor
public class EntryWrappingInterceptor extends DDAsyncInterceptor
Interceptor in charge with wrapping entries and add them in caller's context.- Since:
- 9.0
- Author:
- Mircea Markus, Pedro Ruivo
- See Also:
for overview of entry wrapping.
-
-
Field Summary
Fields Modifier and Type Field Description protected ClusteringDependentLogic
cdl
protected DistributionManager
distributionManager
-
Fields inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
cacheConfiguration
-
-
Constructor Summary
Constructors Constructor Description EntryWrappingInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canRead(DataCommand command)
protected boolean
canReadKey(Object key)
protected CompletionStage<Void>
commitContextEntries(InvocationContext ctx, FlagAffectedCommand command)
protected void
commitContextEntry(CacheEntry entry, InvocationContext ctx, FlagAffectedCommand command, Flag stateTransferFlag, boolean l1Invalidation)
protected Object
setSkipRemoteGetsAndInvokeNextForDataCommand(InvocationContext ctx, org.infinispan.commands.write.DataWriteCommand command, CompletionStage<Void> delay)
Locks the value for the keys accessed by the command to avoid being override from a remote get.protected Object
setSkipRemoteGetsAndInvokeNextForManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.write.WriteCommand command, CompletionStage<Void> delay)
Locks the value for the keys accessed by the command to avoid being override from a remote get.protected boolean
shouldCommitDuringPrepare(org.infinispan.commands.tx.PrepareCommand command, TxInvocationContext ctx)
total order condition: only commits when it is remote context and the prepare has the flag 1PC setvoid
start()
Object
visitClearCommand(InvocationContext ctx, org.infinispan.commands.write.ClearCommand command)
Object
visitCommitCommand(TxInvocationContext ctx, org.infinispan.commands.tx.CommitCommand command)
Object
visitComputeCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeCommand command)
Object
visitComputeIfAbsentCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeIfAbsentCommand command)
Object
visitEvictCommand(InvocationContext ctx, org.infinispan.commands.write.EvictCommand command)
Object
visitGetAllCommand(InvocationContext ctx, org.infinispan.commands.read.GetAllCommand command)
Object
visitGetCacheEntryCommand(InvocationContext ctx, org.infinispan.commands.read.GetCacheEntryCommand command)
Object
visitGetKeysInGroupCommand(InvocationContext ctx, org.infinispan.commands.remote.GetKeysInGroupCommand command)
Object
visitGetKeyValueCommand(InvocationContext ctx, org.infinispan.commands.read.GetKeyValueCommand command)
Object
visitInvalidateCommand(InvocationContext ctx, org.infinispan.commands.write.InvalidateCommand command)
Object
visitInvalidateL1Command(InvocationContext ctx, org.infinispan.commands.write.InvalidateL1Command command)
Object
visitPrepareCommand(TxInvocationContext ctx, org.infinispan.commands.tx.PrepareCommand command)
Object
visitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command)
Object
visitPutMapCommand(InvocationContext ctx, org.infinispan.commands.write.PutMapCommand command)
Object
visitReadOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyKeyCommand command)
Object
visitReadOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyManyCommand command)
Object
visitReadWriteKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyCommand command)
Object
visitReadWriteKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyValueCommand command)
Object
visitReadWriteManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyCommand command)
Object
visitReadWriteManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyEntriesCommand command)
Object
visitRemoveCommand(InvocationContext ctx, org.infinispan.commands.write.RemoveCommand command)
Object
visitRemoveExpiredCommand(InvocationContext ctx, org.infinispan.commands.write.RemoveExpiredCommand command)
Object
visitReplaceCommand(InvocationContext ctx, org.infinispan.commands.write.ReplaceCommand command)
Object
visitWriteOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyCommand command)
Object
visitWriteOnlyKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyValueCommand command)
Object
visitWriteOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyCommand command)
Object
visitWriteOnlyManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyEntriesCommand command)
protected <P extends org.infinispan.commands.tx.PrepareCommand>
ObjectwrapEntriesForPrepareAndApply(TxInvocationContext ctx, P command, InvocationSuccessFunction handler)
-
Methods inherited from class org.infinispan.interceptors.DDAsyncInterceptor
handleDefault, visitCommand, visitDistributedExecuteCommand, visitEntrySetCommand, visitKeySetCommand, visitLockControlCommand, visitRollbackCommand, visitSizeCommand, visitUnknownCommand
-
Methods inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
asyncInvokeNext, asyncInvokeNext, asyncInvokeNext, asyncValue, delayedValue, delayedValue, invokeNext, invokeNextAndExceptionally, invokeNextAndFinally, invokeNextAndHandle, invokeNextThenAccept, invokeNextThenApply, isSuccessfullyDone, makeStage, setNextInterceptor, valueOrException
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.commands.Visitor
visitApplyDeltaCommand
-
-
-
-
Field Detail
-
cdl
protected ClusteringDependentLogic cdl
-
distributionManager
protected DistributionManager distributionManager
-
-
Method Detail
-
start
public void start()
-
canRead
protected boolean canRead(DataCommand command)
-
canReadKey
protected boolean canReadKey(Object key)
-
visitPrepareCommand
public Object visitPrepareCommand(TxInvocationContext ctx, org.infinispan.commands.tx.PrepareCommand command) throws Throwable
- Specified by:
visitPrepareCommand
in interfaceVisitor
- Overrides:
visitPrepareCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitCommitCommand
public Object visitCommitCommand(TxInvocationContext ctx, org.infinispan.commands.tx.CommitCommand command) throws Throwable
- Specified by:
visitCommitCommand
in interfaceVisitor
- Overrides:
visitCommitCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitGetKeyValueCommand
public final Object visitGetKeyValueCommand(InvocationContext ctx, org.infinispan.commands.read.GetKeyValueCommand command) throws Throwable
- Specified by:
visitGetKeyValueCommand
in interfaceVisitor
- Overrides:
visitGetKeyValueCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitGetCacheEntryCommand
public final Object visitGetCacheEntryCommand(InvocationContext ctx, org.infinispan.commands.read.GetCacheEntryCommand command) throws Throwable
- Specified by:
visitGetCacheEntryCommand
in interfaceVisitor
- Overrides:
visitGetCacheEntryCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitGetAllCommand
public Object visitGetAllCommand(InvocationContext ctx, org.infinispan.commands.read.GetAllCommand command) throws Throwable
- Specified by:
visitGetAllCommand
in interfaceVisitor
- Overrides:
visitGetAllCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitInvalidateCommand
public final Object visitInvalidateCommand(InvocationContext ctx, org.infinispan.commands.write.InvalidateCommand command)
- Specified by:
visitInvalidateCommand
in interfaceVisitor
- Overrides:
visitInvalidateCommand
in classDDAsyncInterceptor
-
visitClearCommand
public final Object visitClearCommand(InvocationContext ctx, org.infinispan.commands.write.ClearCommand command) throws Throwable
- Specified by:
visitClearCommand
in interfaceVisitor
- Overrides:
visitClearCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitInvalidateL1Command
public Object visitInvalidateL1Command(InvocationContext ctx, org.infinispan.commands.write.InvalidateL1Command command)
- Specified by:
visitInvalidateL1Command
in interfaceVisitor
- Overrides:
visitInvalidateL1Command
in classDDAsyncInterceptor
-
visitPutKeyValueCommand
public final Object visitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command) throws Throwable
- Specified by:
visitPutKeyValueCommand
in interfaceVisitor
- Overrides:
visitPutKeyValueCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitRemoveCommand
public final Object visitRemoveCommand(InvocationContext ctx, org.infinispan.commands.write.RemoveCommand command) throws Throwable
- Specified by:
visitRemoveCommand
in interfaceVisitor
- Overrides:
visitRemoveCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitRemoveExpiredCommand
public Object visitRemoveExpiredCommand(InvocationContext ctx, org.infinispan.commands.write.RemoveExpiredCommand command) throws Throwable
- Throws:
Throwable
-
visitReplaceCommand
public final Object visitReplaceCommand(InvocationContext ctx, org.infinispan.commands.write.ReplaceCommand command) throws Throwable
- Specified by:
visitReplaceCommand
in interfaceVisitor
- Overrides:
visitReplaceCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitComputeCommand
public Object visitComputeCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeCommand command) throws Throwable
- Specified by:
visitComputeCommand
in interfaceVisitor
- Overrides:
visitComputeCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitComputeIfAbsentCommand
public Object visitComputeIfAbsentCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeIfAbsentCommand command) throws Throwable
- Specified by:
visitComputeIfAbsentCommand
in interfaceVisitor
- Overrides:
visitComputeIfAbsentCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitPutMapCommand
public Object visitPutMapCommand(InvocationContext ctx, org.infinispan.commands.write.PutMapCommand command) throws Throwable
- Specified by:
visitPutMapCommand
in interfaceVisitor
- Overrides:
visitPutMapCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitEvictCommand
public Object visitEvictCommand(InvocationContext ctx, org.infinispan.commands.write.EvictCommand command) throws Throwable
- Specified by:
visitEvictCommand
in interfaceVisitor
- Overrides:
visitEvictCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitGetKeysInGroupCommand
public Object visitGetKeysInGroupCommand(InvocationContext ctx, org.infinispan.commands.remote.GetKeysInGroupCommand command) throws Throwable
- Specified by:
visitGetKeysInGroupCommand
in interfaceVisitor
- Overrides:
visitGetKeysInGroupCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitReadOnlyKeyCommand
public Object visitReadOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyKeyCommand command) throws Throwable
- Specified by:
visitReadOnlyKeyCommand
in interfaceVisitor
- Overrides:
visitReadOnlyKeyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitReadOnlyManyCommand
public Object visitReadOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyManyCommand command) throws Throwable
- Specified by:
visitReadOnlyManyCommand
in interfaceVisitor
- Overrides:
visitReadOnlyManyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitWriteOnlyKeyCommand
public Object visitWriteOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyCommand command) throws Throwable
- Specified by:
visitWriteOnlyKeyCommand
in interfaceVisitor
- Overrides:
visitWriteOnlyKeyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitReadWriteKeyValueCommand
public Object visitReadWriteKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyValueCommand command) throws Throwable
- Specified by:
visitReadWriteKeyValueCommand
in interfaceVisitor
- Overrides:
visitReadWriteKeyValueCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitReadWriteKeyCommand
public Object visitReadWriteKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyCommand command) throws Throwable
- Specified by:
visitReadWriteKeyCommand
in interfaceVisitor
- Overrides:
visitReadWriteKeyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitWriteOnlyManyEntriesCommand
public Object visitWriteOnlyManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyEntriesCommand command) throws Throwable
- Specified by:
visitWriteOnlyManyEntriesCommand
in interfaceVisitor
- Overrides:
visitWriteOnlyManyEntriesCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitWriteOnlyManyCommand
public Object visitWriteOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyCommand command) throws Throwable
- Specified by:
visitWriteOnlyManyCommand
in interfaceVisitor
- Overrides:
visitWriteOnlyManyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitWriteOnlyKeyValueCommand
public Object visitWriteOnlyKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyValueCommand command) throws Throwable
- Specified by:
visitWriteOnlyKeyValueCommand
in interfaceVisitor
- Overrides:
visitWriteOnlyKeyValueCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitReadWriteManyCommand
public Object visitReadWriteManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyCommand command) throws Throwable
- Specified by:
visitReadWriteManyCommand
in interfaceVisitor
- Overrides:
visitReadWriteManyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitReadWriteManyEntriesCommand
public Object visitReadWriteManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyEntriesCommand command) throws Throwable
- Specified by:
visitReadWriteManyEntriesCommand
in interfaceVisitor
- Overrides:
visitReadWriteManyEntriesCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
commitContextEntries
protected final CompletionStage<Void> commitContextEntries(InvocationContext ctx, FlagAffectedCommand command)
-
commitContextEntry
protected void commitContextEntry(CacheEntry entry, InvocationContext ctx, FlagAffectedCommand command, Flag stateTransferFlag, boolean l1Invalidation)
-
setSkipRemoteGetsAndInvokeNextForManyEntriesCommand
protected Object setSkipRemoteGetsAndInvokeNextForManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.write.WriteCommand command, CompletionStage<Void> delay)
Locks the value for the keys accessed by the command to avoid being override from a remote get.
-
setSkipRemoteGetsAndInvokeNextForDataCommand
protected Object setSkipRemoteGetsAndInvokeNextForDataCommand(InvocationContext ctx, org.infinispan.commands.write.DataWriteCommand command, CompletionStage<Void> delay)
Locks the value for the keys accessed by the command to avoid being override from a remote get.
-
shouldCommitDuringPrepare
protected boolean shouldCommitDuringPrepare(org.infinispan.commands.tx.PrepareCommand command, TxInvocationContext ctx)
total order condition: only commits when it is remote context and the prepare has the flag 1PC set- Parameters:
command
- the prepare commandctx
- the invocation context- Returns:
- true if the modification should be committed, false otherwise
-
wrapEntriesForPrepareAndApply
protected final <P extends org.infinispan.commands.tx.PrepareCommand> Object wrapEntriesForPrepareAndApply(TxInvocationContext ctx, P command, InvocationSuccessFunction handler) throws Throwable
- Throws:
Throwable
-
-