public class SimpleAsyncInvocationStage extends InvocationStage
BaseAsyncInterceptor.asyncValue(CompletionStage)
.Modifier and Type | Field and Description |
---|---|
protected CompletableFuture<Object> |
future |
Constructor and Description |
---|
SimpleAsyncInvocationStage(CompletionStage<?> future) |
Modifier and Type | Method and Description |
---|---|
<C extends VisitableCommand> |
addCallback(InvocationContext ctx,
C command,
InvocationCallback<C> function)
After the current stage completes, invoke
function and return its result. |
Object |
get()
Wait for the invocation to complete and return its value.
|
boolean |
isDone() |
Object |
thenReturn(InvocationContext ctx,
VisitableCommand command,
Object returnValue)
Overrides the return value of this
InvocationStage if it is completed successfully. |
CompletableFuture<Object> |
toCompletableFuture()
CompletableFuture conversion. |
String |
toString() |
andExceptionally, andExceptionallyMakeStage, andFinally, andFinallyMakeStage, andHandle, andHandleMakeStage, completedNullStage, makeStage, thenAccept, thenAcceptMakeStage, thenApply, thenApplyMakeStage
protected final CompletableFuture<Object> future
public SimpleAsyncInvocationStage(CompletionStage<?> future)
public Object get() throws Throwable
InvocationStage
get
in class InvocationStage
Throwable
- Any exception raised during the invocation.public boolean isDone()
isDone
in class InvocationStage
true
if the invocation is complete.public CompletableFuture<Object> toCompletableFuture()
InvocationStage
CompletableFuture
conversion.toCompletableFuture
in class InvocationStage
public <C extends VisitableCommand> Object addCallback(InvocationContext ctx, C command, InvocationCallback<C> function)
InvocationStage
function
and return its result.
The result may be either a plain value, or a new InvocationStage
.
If function
throws an exception, the result InvocationStage
will complete with the same exception.
addCallback
in class InvocationStage
public Object thenReturn(InvocationContext ctx, VisitableCommand command, Object returnValue)
InvocationStage
InvocationStage
if it is completed successfully.
The result may be either rv
, a new InvocationStage
or this
thenReturn
in class InvocationStage
Copyright © 2021 JBoss by Red Hat. All rights reserved.