Package org.infinispan.interceptors
Class InvocationStage
- java.lang.Object
-
- org.infinispan.interceptors.InvocationStage
-
- Direct Known Subclasses:
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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ObjectaddCallback(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationCallback function)ObjectandExceptionally(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationExceptionFunction function)ObjectandFinally(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationFinallyAction action)ObjectandHandle(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationFinallyFunction function)abstract Objectget()Wait for the invocation to complete and return its value.abstract booleanisDone()ObjectthenAccept(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationSuccessAction function)ObjectthenApply(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationSuccessFunction function)After the current stage completes successfully, invokefunctionand return its result.abstract CompletableFuture<Object>toCompletableFuture()CompletableFutureconversion.
-
-
-
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:
trueif the invocation is complete.
-
toCompletableFuture
public abstract CompletableFuture<Object> toCompletableFuture()
CompletableFutureconversion.
-
thenApply
public Object thenApply(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationSuccessFunction function)
After the current stage completes successfully, invokefunctionand return its result. The result may be either a plain value, or a newInvocationStage.
-
thenAccept
public Object thenAccept(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationSuccessAction function)
-
andExceptionally
public Object andExceptionally(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationExceptionFunction function)
-
andFinally
public Object andFinally(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationFinallyAction action)
-
andHandle
public Object andHandle(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationFinallyFunction function)
-
addCallback
public abstract Object addCallback(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationCallback function)
-
-