Package org.infinispan.interceptors.impl
Class BatchingInterceptor
- java.lang.Object
-
- org.infinispan.interceptors.BaseAsyncInterceptor
-
- org.infinispan.interceptors.DDAsyncInterceptor
-
- org.infinispan.interceptors.impl.BatchingInterceptor
-
- All Implemented Interfaces:
Visitor
,AsyncInterceptor
public class BatchingInterceptor extends DDAsyncInterceptor
Interceptor that captures batched calls and attaches contexts.- Since:
- 9.0
- Author:
- Manik Surtani (manik@jboss.org)
-
-
Field Summary
-
Fields inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
cacheConfiguration
-
-
Constructor Summary
Constructors Constructor Description BatchingInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
handleDefault(InvocationContext ctx, VisitableCommand command)
Simply check if there is an ongoing tx.Object
visitClearCommand(InvocationContext ctx, org.infinispan.commands.write.ClearCommand command)
Object
visitEvictCommand(InvocationContext ctx, org.infinispan.commands.write.EvictCommand command)
Object
visitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command)
-
Methods inherited from class org.infinispan.interceptors.DDAsyncInterceptor
visitCommand, visitCommitCommand, visitComputeCommand, visitComputeIfAbsentCommand, visitDistributedExecuteCommand, visitEntrySetCommand, visitGetAllCommand, visitGetCacheEntryCommand, visitGetKeysInGroupCommand, visitGetKeyValueCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitPrepareCommand, visitPutMapCommand, visitReadOnlyKeyCommand, visitReadOnlyManyCommand, visitReadWriteKeyCommand, visitReadWriteKeyValueCommand, visitReadWriteManyCommand, visitReadWriteManyEntriesCommand, visitRemoveCommand, visitReplaceCommand, visitRollbackCommand, visitSizeCommand, visitUnknownCommand, visitWriteOnlyKeyCommand, visitWriteOnlyKeyValueCommand, visitWriteOnlyManyCommand, visitWriteOnlyManyEntriesCommand
-
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, visitRemoveExpiredCommand
-
-
-
-
Method Detail
-
visitEvictCommand
public Object visitEvictCommand(InvocationContext ctx, org.infinispan.commands.write.EvictCommand command)
- Specified by:
visitEvictCommand
in interfaceVisitor
- Overrides:
visitEvictCommand
in classDDAsyncInterceptor
-
visitClearCommand
public Object visitClearCommand(InvocationContext ctx, org.infinispan.commands.write.ClearCommand command)
- Specified by:
visitClearCommand
in interfaceVisitor
- Overrides:
visitClearCommand
in classDDAsyncInterceptor
-
visitPutKeyValueCommand
public Object visitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command) throws Throwable
- Specified by:
visitPutKeyValueCommand
in interfaceVisitor
- Overrides:
visitPutKeyValueCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
handleDefault
public Object handleDefault(InvocationContext ctx, VisitableCommand command) throws Throwable
Simply check if there is an ongoing tx.- If there is one, this is a no-op and just passes the call up the chain.
- If there isn't one and there is a batch in progress, resume the batch's tx, pass up, and finally suspend the batch's tx.
- If there is no batch in progress, just pass the call up the chain.
- Overrides:
handleDefault
in classDDAsyncInterceptor
- Throws:
Throwable
-
-