Top Description Fields Constructors Methods
org.springframework.scheduling.config

public final Class ScheduledTask

extends Object
Class Inheritance
Imports
java.util.concurrent.ScheduledFuture, org.springframework.lang.Nullable

A representation of a scheduled task at runtime, used as a return value for scheduling methods.
Author
Juergen Hoeller
Since
4.3
See Also
ScheduledTaskRegistrar#scheduleCronTask(CronTask), ScheduledTaskRegistrar#scheduleFixedRateTask(FixedRateTask), ScheduledTaskRegistrar#scheduleFixedDelayTask(FixedDelayTask), ScheduledFuture

Field Summary

Modifier and TypeField and Description
pack-priv volatile ScheduledFuture<?>
private final Task

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
cancel()

Trigger cancellation of this scheduled task.

public void
cancel(boolean
whether to force interruption of the task if still running (specify false to allow the task to complete)
mayInterruptIfRunning
)

Trigger cancellation of this scheduled task.

public Task
getTask()

Return the underlying task (typically a CronTask, FixedRateTask or FixedDelayTask).

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

futureback to summary
pack-priv volatile ScheduledFuture<?> future
Annotations
@Nullable
taskback to summary
private final Task task

Constructor Detail

ScheduledTaskback to summary
pack-priv ScheduledTask(Task task)

Method Detail

cancelback to summary
public void cancel()

Trigger cancellation of this scheduled task.

This variant will force interruption of the task if still running.

See Also
cancel(boolean)
cancelback to summary
public void cancel(boolean mayInterruptIfRunning)

Trigger cancellation of this scheduled task.

Parameters
mayInterruptIfRunning:boolean

whether to force interruption of the task if still running (specify false to allow the task to complete)

Since
5.3.18
See Also
ScheduledFuture#cancel(boolean)
getTaskback to summary
public Task getTask()

Return the underlying task (typically a CronTask, FixedRateTask or FixedDelayTask).

Since
5.0.2
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override