abstract class TaskUtils
Utility methods for decorating tasks with error handling.
NOTE: This class is intended for internal use by Spring's scheduler implementations. It is only public so that it may be accessed from impl classes within other packages. It is not intended for general use.
Author
Mark Fisher
Author
Juergen Hoeller
Since
3.0
TaskUtils()
Utility methods for decorating tasks with error handling. NOTE: This class is intended for internal use by Spring's scheduler implementations. It is only public so that it may be accessed from impl classes within other packages. It is not intended for general use. |
static val LOG_AND_PROPAGATE_ERROR_HANDLER: ErrorHandler
An ErrorHandler strategy that will log at error level and then re-throw the Exception. Note: this will typically prevent subsequent execution of a scheduled task. |
|
static val LOG_AND_SUPPRESS_ERROR_HANDLER: ErrorHandler
An ErrorHandler strategy that will log the Exception but perform no further handling. This will suppress the error so that subsequent executions of the task will not be prevented. |
open static fun decorateTaskWithErrorHandler(task: Runnable, errorHandler: ErrorHandler, isRepeatingTask: Boolean): DelegatingErrorHandlingRunnable
Decorate the task for error handling. If the provided ErrorHandler is not |
|
open static fun getDefaultErrorHandler(isRepeatingTask: Boolean): ErrorHandler
Return the default ErrorHandler implementation based on the boolean value indicating whether the task will be repeating or not. For repeating tasks it will suppress errors, but for one-time tasks it will propagate. In both cases, the error will be logged. |