Class OperationCanceledException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
OperationTimeoutException

public class OperationCanceledException extends RuntimeException
Thrown by tasks when they detect that they were requested to be canceled.
See Also:
  • org.jtrim2.executor.CancelableTask
  • org.jtrim2.executor.TaskExecutor
  • Serialized Form
  • Constructor Details

    • OperationCanceledException

      public OperationCanceledException(Throwable cause)
      Creates the exception with a specific cause. The detail message will be the string returned by the cause.toString() call.
      Parameters:
      cause - the causing exception of the OperationCanceledException. The cause of OperationCanceledException should usually be null but it is possible to specify the cause to preserve the stack trace of other exceptions signaling cancellation. This argument can be null if there is no cause.
    • OperationCanceledException

      public OperationCanceledException(String message, Throwable cause)
      Creates the exception with a specific detail message and cause.
      Parameters:
      message - the message to be returned by getMessage(). This argument can be null.
      cause - the causing exception of the OperationCanceledException. The cause of OperationCanceledException should usually be null but it is possible to specify the cause to preserve the stack trace of other exceptions signaling cancellation. This argument can be null if there is no cause.
    • OperationCanceledException

      public OperationCanceledException(String message)
      Creates the exception with a specific detail message.
      Parameters:
      message - the message to be returned by getMessage(). This argument can be null.
    • OperationCanceledException

      public OperationCanceledException()
      Creates the exception with null as its detail message.
    • OperationCanceledException

      protected OperationCanceledException(String message, Throwable cause, boolean writableStackTrace)
      Constructs a new runtime exception with the specified detail message, cause, and writable stack trace enabled or disabled.
      Parameters:
      message - the detail message.
      cause - the cause. (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
      writableStackTrace - whether or not the stack trace should be writable
  • Method Details

    • withoutStackTrace

      public static OperationCanceledException withoutStackTrace()
      Returns a new instance of OperationCanceledException without stack trace information. The stack trace cannot be set later.
      Returns:
      a new instance of OperationCanceledException without stack trace information. This method never returns null.
    • withoutStackTrace

      public static OperationCanceledException withoutStackTrace(String message, Throwable cause)
      Returns a new instance of OperationCanceledException without stack trace information. The stack trace cannot be set later.
      Parameters:
      message - the message to be returned by getMessage(). This argument can be null.
      cause - cause the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
      Returns:
      a new instance of OperationCanceledException without stack trace information. This method never returns null.