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 ObjecthandleDefault(InvocationContext ctx, VisitableCommand command)Simply check if there is an ongoing tx.ObjectvisitClearCommand(InvocationContext ctx, ClearCommand command)ObjectvisitEvictCommand(InvocationContext ctx, EvictCommand command)ObjectvisitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command)-
Methods inherited from class org.infinispan.interceptors.DDAsyncInterceptor
visitCommand, visitCommitCommand, visitComputeCommand, visitComputeIfAbsentCommand, 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, delayedNull, 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
visitRemoveExpiredCommand
-
-
-
-
Method Detail
-
visitEvictCommand
public Object visitEvictCommand(InvocationContext ctx, EvictCommand command)
- Specified by:
visitEvictCommandin interfaceVisitor- Overrides:
visitEvictCommandin classDDAsyncInterceptor
-
visitClearCommand
public Object visitClearCommand(InvocationContext ctx, ClearCommand command)
- Specified by:
visitClearCommandin interfaceVisitor- Overrides:
visitClearCommandin classDDAsyncInterceptor
-
visitPutKeyValueCommand
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable
- Specified by:
visitPutKeyValueCommandin interfaceVisitor- Overrides:
visitPutKeyValueCommandin 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:
handleDefaultin classDDAsyncInterceptor- Throws:
Throwable
-
-