Package org.infinispan.interceptors
Class InvocationStage
- java.lang.Object
-
- org.infinispan.interceptors.InvocationStage
-
- Direct Known Subclasses:
SyncInvocationStage
public abstract class InvocationStage extends java.lang.ObjectA 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 java.lang.ObjectaddCallback(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationCallback function)java.lang.ObjectandExceptionally(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationExceptionFunction function)java.lang.ObjectandFinally(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationFinallyAction action)java.lang.ObjectandHandle(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationFinallyFunction function)abstract java.lang.Objectget()Wait for the invocation to complete and return its value.abstract booleanisDone()java.lang.ObjectthenAccept(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationSuccessAction function)java.lang.ObjectthenApply(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationSuccessFunction function)After the current stage completes successfully, invokefunctionand return its result.abstract java.util.concurrent.CompletableFuture<java.lang.Object>toCompletableFuture()CompletableFutureconversion.
-
-
-
Method Detail
-
get
public abstract java.lang.Object get() throws java.lang.ThrowableWait for the invocation to complete and return its value.- Throws:
java.lang.Throwable- Any exception raised during the invocation.
-
isDone
public abstract boolean isDone()
- Returns:
trueif the invocation is complete.
-
toCompletableFuture
public abstract java.util.concurrent.CompletableFuture<java.lang.Object> toCompletableFuture()
CompletableFutureconversion.
-
thenApply
public java.lang.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 java.lang.Object thenAccept(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationSuccessAction function)
-
andExceptionally
public java.lang.Object andExceptionally(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationExceptionFunction function)
-
andFinally
public java.lang.Object andFinally(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationFinallyAction action)
-
andHandle
public java.lang.Object andHandle(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationFinallyFunction function)
-
addCallback
public abstract java.lang.Object addCallback(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationCallback function)
-
-