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 Object
addCallback(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationCallback function)
Object
andExceptionally(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationExceptionFunction function)
Object
andFinally(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationFinallyAction action)
Object
andHandle(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationFinallyFunction function)
abstract Object
get()
Wait for the invocation to complete and return its value.abstract boolean
isDone()
Object
thenAccept(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationSuccessAction function)
Object
thenApply(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationSuccessFunction function)
After the current stage completes successfully, invokefunction
and return its result.abstract CompletableFuture<Object>
toCompletableFuture()
CompletableFuture
conversion.
-
-
-
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, org.infinispan.commands.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, 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)
-
-