Package org.infinispan.interceptors.impl
Class SimpleAsyncInvocationStage
- java.lang.Object
-
- org.infinispan.interceptors.InvocationStage
-
- org.infinispan.interceptors.impl.SimpleAsyncInvocationStage
-
- Direct Known Subclasses:
QueueAsyncInvocationStage
public class SimpleAsyncInvocationStage extends InvocationStage
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 Modifier and Type Field Description protected CompletableFuture<Object>
future
-
Constructor Summary
Constructors Constructor Description SimpleAsyncInvocationStage(Throwable throwable)
SimpleAsyncInvocationStage(CompletionStage<?> future)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
addCallback(InvocationContext ctx, VisitableCommand command, InvocationCallback function)
Object
get()
Wait for the invocation to complete and return its value.boolean
isDone()
CompletableFuture<Object>
toCompletableFuture()
CompletableFuture
conversion.String
toString()
-
Methods inherited from class org.infinispan.interceptors.InvocationStage
andExceptionally, andFinally, andHandle, thenAccept, thenApply
-
-
-
-
Field Detail
-
future
protected final CompletableFuture<Object> future
-
-
Constructor Detail
-
SimpleAsyncInvocationStage
public SimpleAsyncInvocationStage(CompletionStage<?> future)
-
SimpleAsyncInvocationStage
public SimpleAsyncInvocationStage(Throwable throwable)
-
-
Method Detail
-
get
public Object get() throws Throwable
Description copied from class:InvocationStage
Wait for the invocation to complete and return its value.- Specified by:
get
in classInvocationStage
- Throws:
Throwable
- Any exception raised during the invocation.
-
isDone
public boolean isDone()
- Specified by:
isDone
in classInvocationStage
- Returns:
true
if the invocation is complete.
-
toCompletableFuture
public CompletableFuture<Object> toCompletableFuture()
Description copied from class:InvocationStage
CompletableFuture
conversion.- Specified by:
toCompletableFuture
in classInvocationStage
-
addCallback
public Object addCallback(InvocationContext ctx, VisitableCommand command, InvocationCallback function)
- Specified by:
addCallback
in classInvocationStage
-
-