Class TemporalOperationCancelContext

java.lang.Object
io.temporal.nexus.TemporalOperationCancelContext

@Experimental public final class TemporalOperationCancelContext extends Object
  • Method Details

    • getService

      public String getService()
      Returns the service name for this operation.
    • getOperation

      public String getOperation()
      Returns the operation name.
    • getHeaders

      public Map<String,String> getHeaders()
      Returns the headers for this cancel request. The returned map is case-insensitive.
    • getDeadline

      public @Nullable Instant 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

      public String 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

      public @Nullable String 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.