java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.jtrim2.cancel.OperationCanceledException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
OperationTimeoutException
Thrown by tasks when they detect that they were requested to be canceled.
- See Also:
-
org.jtrim2.executor.CancelableTaskorg.jtrim2.executor.TaskExecutor- Serialized Form
-
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates the exception withnullas itsdetail message.OperationCanceledException(String message) Creates the exception with a specificdetail message.OperationCanceledException(String message, Throwable cause) Creates the exception with a specificdetail messageandcause.protectedOperationCanceledException(String message, Throwable cause, boolean writableStackTrace) Constructs a new runtime exception with the specified detail message, cause, and writable stack trace enabled or disabled.Creates the exception with a specificcause. -
Method Summary
Modifier and TypeMethodDescriptionstatic OperationCanceledExceptionReturns a new instance ofOperationCanceledExceptionwithout stack trace information.static OperationCanceledExceptionwithoutStackTrace(String message, Throwable cause) Returns a new instance ofOperationCanceledExceptionwithout stack trace information.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
OperationCanceledException
Creates the exception with a specificcause. Thedetail messagewill be the string returned by thecause.toString()call.- Parameters:
cause- the causing exception of theOperationCanceledException. The cause ofOperationCanceledExceptionshould usually benullbut it is possible to specify the cause to preserve the stack trace of other exceptions signaling cancellation. This argument can benullif there is no cause.
-
OperationCanceledException
Creates the exception with a specificdetail messageandcause.- Parameters:
message- the message to be returned bygetMessage(). This argument can benull.cause- the causing exception of theOperationCanceledException. The cause ofOperationCanceledExceptionshould usually benullbut it is possible to specify the cause to preserve the stack trace of other exceptions signaling cancellation. This argument can benullif there is no cause.
-
OperationCanceledException
Creates the exception with a specificdetail message.- Parameters:
message- the message to be returned bygetMessage(). This argument can benull.
-
OperationCanceledException
public OperationCanceledException()Creates the exception withnullas itsdetail message. -
OperationCanceledException
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. (Anullvalue is permitted, and indicates that the cause is nonexistent or unknown.)writableStackTrace- whether or not the stack trace should be writable
-
-
Method Details
-
withoutStackTrace
Returns a new instance ofOperationCanceledExceptionwithout stack trace information. The stack trace cannot be set later.- Returns:
- a new instance of
OperationCanceledExceptionwithout stack trace information. This method never returnsnull.
-
withoutStackTrace
Returns a new instance ofOperationCanceledExceptionwithout stack trace information. The stack trace cannot be set later.- Parameters:
message- the message to be returned bygetMessage(). This argument can benull.cause- cause the cause (which is saved for later retrieval by theThrowable.getCause()method). (Anullvalue is permitted, and indicates that the cause is nonexistent or unknown.)- Returns:
- a new instance of
OperationCanceledExceptionwithout stack trace information. This method never returnsnull.
-