Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
* Holder class defining a {@code Runnable} to be executed as a task, typically at a
* scheduled time or interval. See subclass hierarchy for various scheduling approaches.
*
* <p><strong>Note:</strong> this is not merely a holder for the user-provided
* {@code Runnable}. The framework may wrap the runnable instance for scheduling
* or observability purposes (for example with {@code OutcomeTrackingRunnable},
* {@code SchedulingAwareRunnable}, or {@code SubscribingRunnable}). The runnable
* returned by {@link #getRunnable()} is the one to execute, and it may differ
* from the original object supplied by the user.
*
* @author Chris Beams
* @author Juergen Hoeller
* @author Brian Clozel
Expand All @@ -40,6 +47,8 @@ public class Task {

/**
* Create a new {@code Task}.
* <p>The provided runnable may be wrapped by the framework; see the class-level
* Javadoc for details.
* @param runnable the underlying task to execute
*/
public Task(Runnable runnable) {
Expand All @@ -51,6 +60,8 @@ public Task(Runnable runnable) {

/**
* Return the underlying task.
* <p>Note that this may be a framework wrapper around the original runnable
* supplied at construction time.
*/
public Runnable getRunnable() {
return this.runnable;
Expand Down