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 CustomTaskFailedException
Creates aCustomTaskFailedException
that tells the server not to run the task again.static CustomTaskFailedException
reschedule
(String message) Creates aCustomTaskFailedException
that tells the server to reschedule the task normally.static CustomTaskFailedException
Creates aCustomTaskFailedException
that tells the server to retry the task immediately.boolean
Indicates whether the server should cancel the task that threw the exception.boolean
Indicates whether the server should reschedule the task that threw the exception.boolean
Indicates 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 aCustomTaskFailedException
that tells the server to retry the task immediately.- Parameters:
message
- The exception message.- Returns:
- See above.
-
reschedule
Creates aCustomTaskFailedException
that tells the server to reschedule the task normally.- Parameters:
message
- The exception message.- Returns:
- See above.
-
cancel
Creates aCustomTaskFailedException
that 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:
true
if the server should retry the task;false
otherwise.
-
shouldReschedule
public boolean shouldReschedule()Indicates whether the server should reschedule the task that threw the exception.- Returns:
true
if the server should reschedule the task;false
otherwise.
-
shouldCancel
public boolean shouldCancel()Indicates whether the server should cancel the task that threw the exception.- Returns:
true
if the server should cancel the task;false
otherwise.
-