Package org.infinispan.interceptors.impl
Class SimpleAsyncInvocationStage
java.lang.Object
org.infinispan.interceptors.InvocationStage
org.infinispan.interceptors.impl.SimpleAsyncInvocationStage
- Direct Known Subclasses:
QueueAsyncInvocationStage
Invocation stage representing a computation that may or may not be done yet.
It is only meant to support the simplest asynchronous invocation,
BaseAsyncInterceptor.asyncValue(CompletionStage).- Since:
- 9.0
- Author:
- Dan Berindei
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<C extends VisitableCommand>
ObjectaddCallback(InvocationContext ctx, C command, InvocationCallback<C> function) After the current stage completes, invokefunctionand return its result.get()Wait for the invocation to complete and return its value.booleanisDone()thenReturn(InvocationContext ctx, VisitableCommand command, Object returnValue) Overrides the return value of thisInvocationStageif it is completed successfully.CompletableFutureconversion.toString()Methods inherited from class org.infinispan.interceptors.InvocationStage
andExceptionally, andExceptionallyMakeStage, andFinally, andFinallyMakeStage, andHandle, andHandleMakeStage, completedNullStage, makeStage, thenAccept, thenAcceptMakeStage, thenApply, thenApplyMakeStage
-
Field Details
-
future
-
-
Constructor Details
-
SimpleAsyncInvocationStage
-
-
Method Details
-
get
Description copied from class:InvocationStageWait for the invocation to complete and return its value.- Specified by:
getin classInvocationStage- Throws:
Throwable- Any exception raised during the invocation.
-
isDone
public boolean isDone()- Specified by:
isDonein classInvocationStage- Returns:
trueif the invocation is complete.
-
toCompletableFuture
Description copied from class:InvocationStageCompletableFutureconversion.- Specified by:
toCompletableFuturein classInvocationStage
-
addCallback
public <C extends VisitableCommand> Object addCallback(InvocationContext ctx, C command, InvocationCallback<C> function) Description copied from class:InvocationStageAfter the current stage completes, invokefunctionand return its result.The result may be either a plain value, or a new
InvocationStage. Iffunctionthrows an exception, the resultInvocationStagewill complete with the same exception.- Specified by:
addCallbackin classInvocationStage
-
thenReturn
Description copied from class:InvocationStageOverrides the return value of thisInvocationStageif it is completed successfully. The result may be eitherrv, a newInvocationStageorthis- Overrides:
thenReturnin classInvocationStage
-
toString
-