Class TemporalOperationCancelContext
java.lang.Object
io.temporal.nexus.TemporalOperationCancelContext
Context for a Nexus cancel operation request, passed to
TemporalOperationHandler.cancelWorkflowRun(io.temporal.nexus.TemporalOperationCancelContext, io.temporal.nexus.CancelWorkflowRunInput).-
Method Summary
Modifier and TypeMethodDescriptionvoidaddMethodCancellationListener(io.nexusrpc.handler.OperationMethodCancellationListener listener) Add a listener for method cancellation.@Nullable InstantReturns the deadline for the operation handler method.Returns the headers for this cancel request.@Nullable StringReason the handler method was cancelled, or null if not cancelled.Returns the operation name.Returns the operation token identifying the operation to cancel.Returns the service name for this operation.booleanTrue if the handler method has been cancelled.voidremoveMethodCancellationListener(io.nexusrpc.handler.OperationMethodCancellationListener listener) Remove a method cancellation listener, if present.
-
Method Details
-
getService
Returns the service name for this operation. -
getOperation
Returns the operation name. -
getHeaders
-
getDeadline
Returns the deadline for the operation handler method. This is the time by which the method should complete. This is not the operation's deadline. -
getOperationToken
Returns the operation token identifying the operation to cancel. -
isMethodCancelled
public boolean isMethodCancelled()True if the handler method has been cancelled. Note, this is method cancellation, unrelated to operation cancellation. -
getMethodCancellationReason
Reason the handler method was cancelled, or null if not cancelled. Note, this is method cancellation, unrelated to operation cancellation. -
addMethodCancellationListener
public void addMethodCancellationListener(io.nexusrpc.handler.OperationMethodCancellationListener listener) Add a listener for method cancellation. The listener is invoked immediately before this method returns if the method is already cancelled. The listener must not block and must not be registered from within another cancellation listener. -
removeMethodCancellationListener
public void removeMethodCancellationListener(io.nexusrpc.handler.OperationMethodCancellationListener listener) Remove a method cancellation listener, if present. Must not be called from within another cancellation listener.
-