Package org.infinispan.interceptors
Class InvocationStage
- java.lang.Object
-
- org.infinispan.interceptors.InvocationStage
-
- Direct Known Subclasses:
SimpleAsyncInvocationStage
,SyncInvocationStage
public abstract class InvocationStage extends Object
A partial command invocation, either completed or in progress. It is similar to aCompletionStage
, but it allows more callback functions to be stateless by passing the context and the invoked command as parameters. UnlikeCompletionStage
, adding a callback can delay the completion of the initial stage and change its result.- Since:
- 9.0
- Author:
- Dan Berindei
-
-
Constructor Summary
Constructors Constructor Description InvocationStage()
-
Method Summary
-
-
-
Method Detail
-
get
public abstract Object get() throws Throwable
Wait for the invocation to complete and return its value.- Throws:
Throwable
- Any exception raised during the invocation.
-
isDone
public abstract boolean isDone()
- Returns:
true
if the invocation is complete.
-
toCompletableFuture
public abstract CompletableFuture<Object> toCompletableFuture()
CompletableFuture
conversion.
-
thenApply
public Object thenApply(InvocationContext ctx, VisitableCommand command, InvocationSuccessFunction function)
After the current stage completes successfully, invokefunction
and return its result. The result may be either a plain value, or a newInvocationStage
.
-
thenAccept
public Object thenAccept(InvocationContext ctx, VisitableCommand command, InvocationSuccessAction function)
-
andExceptionally
public Object andExceptionally(InvocationContext ctx, VisitableCommand command, InvocationExceptionFunction function)
-
andFinally
public Object andFinally(InvocationContext ctx, VisitableCommand command, InvocationFinallyAction action)
-
andHandle
public Object andHandle(InvocationContext ctx, VisitableCommand command, InvocationFinallyFunction function)
-
addCallback
public abstract Object addCallback(InvocationContext ctx, VisitableCommand command, InvocationCallback function)
-
-