Class ExceptionSyncInvocationStage
- java.lang.Object
-
- org.infinispan.interceptors.InvocationStage
-
- org.infinispan.interceptors.ExceptionSyncInvocationStage
-
public class ExceptionSyncInvocationStage extends InvocationStage
A syncInvocationStage
forThrowable
.It is similar to
SyncInvocationStage
but instead of being used with a successful value, it accepts aThrowable
- Since:
- 10.0
- Author:
- Pedro Ruivo
-
-
Constructor Summary
Constructors Constructor Description ExceptionSyncInvocationStage(java.lang.Throwable throwable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
addCallback(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationCallback function)
After the current stage completes, invokefunction
and return its result.java.lang.Object
andExceptionally(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationExceptionFunction function)
After the current stage completes exceptionally, invokefunction
and return its result.java.lang.Object
andFinally(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationFinallyAction action)
After the current stage completes, invokeaction
.java.lang.Object
andHandle(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationFinallyFunction function)
After the current stage completes, invokefunction
and return its result.java.lang.Object
get()
Wait for the invocation to complete and return its value.boolean
isDone()
java.lang.Object
thenAccept(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationSuccessAction function)
After the current stage completes successfully, invokeaction
.java.lang.Object
thenApply(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationSuccessFunction function)
After the current stage completes successfully, invokefunction
and return its result.java.lang.Object
thenReturn(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, java.lang.Object returnValue)
Overrides the return value of thisInvocationStage
if it is completed successfully.java.util.concurrent.CompletableFuture<java.lang.Object>
toCompletableFuture()
CompletableFuture
conversion.-
Methods inherited from class org.infinispan.interceptors.InvocationStage
andExceptionallyMakeStage, andFinallyMakeStage, andHandleMakeStage, completedNullStage, makeStage, thenAcceptMakeStage, thenApplyMakeStage
-
-
-
-
Method Detail
-
thenApply
public java.lang.Object thenApply(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationSuccessFunction function)
Description copied from class:InvocationStage
After the current stage completes successfully, invokefunction
and return its result.The result may be either a plain value,
this
, or a newInvocationStage
. Iffunction
throws an exception, the resultInvocationStage
will complete with the same exception.- Overrides:
thenApply
in classInvocationStage
-
thenAccept
public java.lang.Object thenAccept(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationSuccessAction function)
Description copied from class:InvocationStage
After the current stage completes successfully, invokeaction
.The result may be either a plain value,
this
, or a newInvocationStage
. Ifaction
throws an exception, the resultInvocationStage
will complete with the same exception.- Overrides:
thenAccept
in classInvocationStage
-
andExceptionally
public java.lang.Object andExceptionally(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationExceptionFunction function)
Description copied from class:InvocationStage
After the current stage completes exceptionally, invokefunction
and return its result.The result may be either a plain value,
this
, or a newInvocationStage
. Iffunction
throws an exception, the resultInvocationStage
will complete with the same exception.- Overrides:
andExceptionally
in classInvocationStage
-
andFinally
public java.lang.Object andFinally(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationFinallyAction action)
Description copied from class:InvocationStage
After the current stage completes, invokeaction
.The result may be either a plain value,
this
, or a newInvocationStage
. Ifaction
throws an exception, the resultInvocationStage
will complete with the same exception.- Overrides:
andFinally
in classInvocationStage
-
andHandle
public java.lang.Object andHandle(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationFinallyFunction function)
Description copied from class:InvocationStage
After the current stage completes, invokefunction
and return its result.The result may be either a plain value,
this
, or a newInvocationStage
. Iffunction
throws an exception, the resultInvocationStage
will complete with the same exception.- Overrides:
andHandle
in classInvocationStage
-
thenReturn
public java.lang.Object thenReturn(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, java.lang.Object returnValue)
Description copied from class:InvocationStage
Overrides the return value of thisInvocationStage
if it is completed successfully. The result may be eitherrv
, a newInvocationStage
orthis
- Overrides:
thenReturn
in classInvocationStage
-
get
public java.lang.Object get() throws java.lang.Throwable
Description copied from class:InvocationStage
Wait for the invocation to complete and return its value.- Specified by:
get
in classInvocationStage
- Throws:
java.lang.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 java.util.concurrent.CompletableFuture<java.lang.Object> toCompletableFuture()
Description copied from class:InvocationStage
CompletableFuture
conversion.- Specified by:
toCompletableFuture
in classInvocationStage
-
addCallback
public java.lang.Object addCallback(InvocationContext ctx, org.infinispan.commands.VisitableCommand command, InvocationCallback function)
Description copied from class:InvocationStage
After the current stage completes, invokefunction
and return its result.The result may be either a plain value, or a new
InvocationStage
. Iffunction
throws an exception, the resultInvocationStage
will complete with the same exception.- Specified by:
addCallback
in classInvocationStage
-
-