Package org.springframework.scheduling.config

# Class OneTimeTask

java.lang.Object
org.springframework.scheduling.config.Task
org.springframework.scheduling.config.DelayedTask
org.springframework.scheduling.config.OneTimeTask

public class OneTimeTask extends DelayedTask
`Task` implementation defining a `Runnable` with an initial delay.

Since:
  6.1
Author:
  Juergen Hoeller
See Also:
  - `ScheduledTaskRegistrar.addOneTimeTask(DelayedTask)`

## Constructor Summary

Constructors
Constructor
Description
`OneTimeTask(Runnable runnable, Duration initialDelay)`
Create a new `DelayedTask`.

## Method Summary

### Methods inherited from class org.springframework.scheduling.config.DelayedTask

`getInitialDelayDuration`

### Methods inherited from class org.springframework.scheduling.config.Task

`getLastExecutionOutcome, getRunnable, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### OneTimeTask

public OneTimeTask(Runnable runnable, Duration initialDelay)
Create a new `DelayedTask`.

Parameters:
  `runnable` - the underlying task to execute
  `initialDelay` - the initial delay before execution of the task