| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.scheduling.support.TaskUtils
public 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 implementations within other packages. It is not intended for general use and may change in the future.
| Field Summary | |
|---|---|
| static ErrorHandler | LOG_AND_PROPAGATE_ERROR_HANDLERAn ErrorHandler strategy that will log at error level and then re-throw the Exception. | 
| static ErrorHandler | LOG_AND_SUPPRESS_ERROR_HANDLERAn ErrorHandler strategy that will log the Exception but perform no further handling. | 
| Constructor Summary | |
|---|---|
| TaskUtils() | |
| Method Summary | |
|---|---|
| static DelegatingErrorHandlingRunnable | decorateTaskWithErrorHandler(Runnable task,
                             ErrorHandler errorHandler,
                             boolean isRepeatingTask)Decorates the task for error handling. | 
| static ErrorHandler | getDefaultErrorHandler(boolean isRepeatingTask)Return the default ErrorHandlerimplementation based on the boolean
 value indicating whether the task will be repeating or not. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final ErrorHandler LOG_AND_SUPPRESS_ERROR_HANDLER
public static final ErrorHandler LOG_AND_PROPAGATE_ERROR_HANDLER
| Constructor Detail | 
|---|
public TaskUtils()
| Method Detail | 
|---|
public static DelegatingErrorHandlingRunnable decorateTaskWithErrorHandler(Runnable task,
                                                                           ErrorHandler errorHandler,
                                                                           boolean isRepeatingTask)
ErrorHandler is not null, it will be used. Otherwise,
 repeating tasks will have errors suppressed by default whereas
 one-shot tasks will have errors propagated by default since those
 errors may be expected through the returned Future. In both
 cases, the errors will be logged.
public static ErrorHandler getDefaultErrorHandler(boolean isRepeatingTask)
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.
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||