Package com.i2group.disco.task.spi
Class CustomTaskFailedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.i2group.disco.task.spi.CustomTaskFailedException
- All Implemented Interfaces:
Serializable
An exception to throw when some aspect of a scheduled custom task fails. The contents of the
exception tell the server whether to execute the task again (immediately, or on its normal
schedule), or to cancel the task and not attempt to execute it again.
- Since:
- 12.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic CustomTaskFailedExceptionCreates aCustomTaskFailedExceptionthat tells the server not to run the task again.static CustomTaskFailedExceptionreschedule(String message) Creates aCustomTaskFailedExceptionthat tells the server to reschedule the task normally.static CustomTaskFailedExceptionCreates aCustomTaskFailedExceptionthat tells the server to retry the task immediately.booleanIndicates whether the server should cancel the task that threw the exception.booleanIndicates whether the server should reschedule the task that threw the exception.booleanIndicates whether the server should retry the task that threw the exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Method Details
-
retry
Creates aCustomTaskFailedExceptionthat tells the server to retry the task immediately.- Parameters:
message- The exception message.- Returns:
- See above.
-
reschedule
Creates aCustomTaskFailedExceptionthat tells the server to reschedule the task normally.- Parameters:
message- The exception message.- Returns:
- See above.
-
cancel
Creates aCustomTaskFailedExceptionthat tells the server not to run the task again.- Parameters:
message- The exception message.- Returns:
- See above.
-
shouldRetry
public boolean shouldRetry()Indicates whether the server should retry the task that threw the exception.- Returns:
trueif the server should retry the task;falseotherwise.
-
shouldReschedule
public boolean shouldReschedule()Indicates whether the server should reschedule the task that threw the exception.- Returns:
trueif the server should reschedule the task;falseotherwise.
-
shouldCancel
public boolean shouldCancel()Indicates whether the server should cancel the task that threw the exception.- Returns:
trueif the server should cancel the task;falseotherwise.
-