public class ExceptionSyncInvocationStage extends InvocationStage
InvocationStage
for Throwable
.
It is similar to SyncInvocationStage
but instead of being used with a successful value, it accepts a Throwable
Constructor and Description |
---|
ExceptionSyncInvocationStage(Throwable throwable) |
Modifier and Type | Method and Description |
---|---|
Object |
addCallback(InvocationContext ctx,
VisitableCommand command,
InvocationCallback function)
After the current stage completes, invoke
function and return its result. |
Object |
andExceptionally(InvocationContext ctx,
VisitableCommand command,
InvocationExceptionFunction function)
After the current stage completes exceptionally, invoke
function and return its result. |
Object |
andFinally(InvocationContext ctx,
VisitableCommand command,
InvocationFinallyAction action)
After the current stage completes, invoke
action . |
Object |
andHandle(InvocationContext ctx,
VisitableCommand command,
InvocationFinallyFunction 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 |
thenAccept(InvocationContext ctx,
VisitableCommand command,
InvocationSuccessAction function)
After the current stage completes successfully, invoke
action . |
Object |
thenApply(InvocationContext ctx,
VisitableCommand command,
InvocationSuccessFunction function)
After the current stage completes successfully, invoke
function and return its result. |
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. |
andExceptionallyMakeStage, andFinallyMakeStage, andHandleMakeStage, completedNullStage, makeStage, thenAcceptMakeStage, thenApplyMakeStage
public ExceptionSyncInvocationStage(Throwable throwable)
public Object thenApply(InvocationContext ctx, VisitableCommand command, InvocationSuccessFunction function)
InvocationStage
function
and return its result.
The result may be either a plain value, this
, or a new InvocationStage
.
If function
throws an exception, the result InvocationStage
will complete with the same exception.
thenApply
in class InvocationStage
public Object thenAccept(InvocationContext ctx, VisitableCommand command, InvocationSuccessAction function)
InvocationStage
action
.
The result may be either a plain value, this
, or a new InvocationStage
.
If action
throws an exception, the result InvocationStage
will complete with the same exception.
thenAccept
in class InvocationStage
public Object andExceptionally(InvocationContext ctx, VisitableCommand command, InvocationExceptionFunction function)
InvocationStage
function
and return its result.
The result may be either a plain value, this
, or a new InvocationStage
.
If function
throws an exception, the result InvocationStage
will complete with the same exception.
andExceptionally
in class InvocationStage
public Object andFinally(InvocationContext ctx, VisitableCommand command, InvocationFinallyAction action)
InvocationStage
action
.
The result may be either a plain value, this
, or a new InvocationStage
.
If action
throws an exception, the result InvocationStage
will complete with the same exception.
andFinally
in class InvocationStage
public Object andHandle(InvocationContext ctx, VisitableCommand command, InvocationFinallyFunction function)
InvocationStage
function
and return its result.
The result may be either a plain value, this
, or a new InvocationStage
.
If function
throws an exception, the result InvocationStage
will complete with the same exception.
andHandle
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
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 Object addCallback(InvocationContext ctx, VisitableCommand command, InvocationCallback 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
Copyright © 2021 JBoss by Red Hat. All rights reserved.