Package org.springframework.security.scheduling

# Class DelegatingSecurityContextTaskScheduler

java.lang.Object
org.springframework.security.scheduling.DelegatingSecurityContextTaskScheduler

All Implemented Interfaces:
  `org.springframework.scheduling.TaskScheduler`

public class DelegatingSecurityContextTaskScheduler extends Object implements org.springframework.scheduling.TaskScheduler
An implementation of `TaskScheduler` invoking it whenever the trigger indicates a next execution time.

Since:
  5.1

## Constructor Summary

Constructors
Constructor
Description
`DelegatingSecurityContextTaskScheduler(org.springframework.scheduling.TaskScheduler delegate)`
Creates a new `DelegatingSecurityContextTaskScheduler` that uses the current `SecurityContext` from the `SecurityContextHolder`.
`DelegatingSecurityContextTaskScheduler(org.springframework.scheduling.TaskScheduler delegateTaskScheduler, SecurityContext securityContext)`
Creates a new `DelegatingSecurityContextTaskScheduler` that uses the specified `SecurityContext`.

## Method Summary

Modifier and Type
Method
Description
`Clock`
`getClock()`
`ScheduledFuture<?>`
`schedule(Runnable task, Instant startTime)`
`ScheduledFuture<?>`
`schedule(Runnable task, Date startTime)`
`ScheduledFuture<?>`
`schedule(Runnable task, org.springframework.scheduling.Trigger trigger)`
`ScheduledFuture<?>`
`scheduleAtFixedRate(Runnable task, long period)`
`ScheduledFuture<?>`
`scheduleAtFixedRate(Runnable task, Duration period)`
`ScheduledFuture<?>`
`scheduleAtFixedRate(Runnable task, Instant startTime, Duration period)`
`ScheduledFuture<?>`
`scheduleAtFixedRate(Runnable task, Date startTime, long period)`
`ScheduledFuture<?>`
`scheduleWithFixedDelay(Runnable task, long delay)`
`ScheduledFuture<?>`
`scheduleWithFixedDelay(Runnable task, Duration delay)`
`ScheduledFuture<?>`
`scheduleWithFixedDelay(Runnable task, Instant startTime, Duration delay)`
`ScheduledFuture<?>`
`scheduleWithFixedDelay(Runnable task, Date startTime, long delay)`

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

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

## Constructor Details

### DelegatingSecurityContextTaskScheduler

public DelegatingSecurityContextTaskScheduler(org.springframework.scheduling.TaskScheduler delegateTaskScheduler, SecurityContext securityContext)
Creates a new `DelegatingSecurityContextTaskScheduler` that uses the specified `SecurityContext`.

Parameters:
  `delegateTaskScheduler` - the `TaskScheduler` to delegate to. Cannot be null.
  `securityContext` - the `SecurityContext` to use for each `DelegatingSecurityContextRunnable` or null to default to the current `SecurityContext`
Since:
  5.6

### DelegatingSecurityContextTaskScheduler

public DelegatingSecurityContextTaskScheduler(org.springframework.scheduling.TaskScheduler delegate)
Creates a new `DelegatingSecurityContextTaskScheduler` that uses the current `SecurityContext` from the `SecurityContextHolder`.

Parameters:
  `delegate` - the `TaskExecutor` to delegate to. Cannot be null.

## Method Details

### schedule

public ScheduledFuture<?> schedule(Runnable task, org.springframework.scheduling.Trigger trigger)

Specified by:
  `schedule` in interface `org.springframework.scheduling.TaskScheduler`

### schedule

public ScheduledFuture<?> schedule(Runnable task, Date startTime)

Specified by:
  `schedule` in interface `org.springframework.scheduling.TaskScheduler`

### scheduleAtFixedRate

public ScheduledFuture<?> scheduleAtFixedRate(Runnable task, Date startTime, long period)

Specified by:
  `scheduleAtFixedRate` in interface `org.springframework.scheduling.TaskScheduler`

### scheduleAtFixedRate

public ScheduledFuture<?> scheduleAtFixedRate(Runnable task, long period)

Specified by:
  `scheduleAtFixedRate` in interface `org.springframework.scheduling.TaskScheduler`

### scheduleWithFixedDelay

public ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, Date startTime, long delay)

Specified by:
  `scheduleWithFixedDelay` in interface `org.springframework.scheduling.TaskScheduler`

### scheduleWithFixedDelay

public ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, long delay)

Specified by:
  `scheduleWithFixedDelay` in interface `org.springframework.scheduling.TaskScheduler`

### schedule

public ScheduledFuture<?> schedule(Runnable task, Instant startTime)

Specified by:
  `schedule` in interface `org.springframework.scheduling.TaskScheduler`

### scheduleAtFixedRate

public ScheduledFuture<?> scheduleAtFixedRate(Runnable task, Instant startTime, Duration period)

Specified by:
  `scheduleAtFixedRate` in interface `org.springframework.scheduling.TaskScheduler`

### scheduleAtFixedRate

public ScheduledFuture<?> scheduleAtFixedRate(Runnable task, Duration period)

Specified by:
  `scheduleAtFixedRate` in interface `org.springframework.scheduling.TaskScheduler`

### scheduleWithFixedDelay

public ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, Instant startTime, Duration delay)

Specified by:
  `scheduleWithFixedDelay` in interface `org.springframework.scheduling.TaskScheduler`

### scheduleWithFixedDelay

public ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, Duration delay)

Specified by:
  `scheduleWithFixedDelay` in interface `org.springframework.scheduling.TaskScheduler`

### getClock

public Clock getClock()

Specified by:
  `getClock` in interface `org.springframework.scheduling.TaskScheduler`