diff --git a/org.springframework.context/src/main/java/org/springframework/scheduling/support/TaskUtils.java b/org.springframework.context/src/main/java/org/springframework/scheduling/support/TaskUtils.java index 3b9bfc284a..e7b3d7595b 100644 --- a/org.springframework.context/src/main/java/org/springframework/scheduling/support/TaskUtils.java +++ b/org.springframework.context/src/main/java/org/springframework/scheduling/support/TaskUtils.java @@ -26,6 +26,11 @@ import org.springframework.util.ReflectionUtils; /** * 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. * * @author Mark Fisher * @since 3.0 @@ -65,6 +70,12 @@ public abstract class TaskUtils { return new DelegatingErrorHandlingRunnable(task, eh); } + /** + * Return the default {@link 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. + */ public static ErrorHandler getDefaultErrorHandler(boolean isRepeatingTask) { return (isRepeatingTask ? LOG_AND_SUPPRESS_ERROR_HANDLER : LOG_AND_PROPAGATE_ERROR_HANDLER); }