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 SummaryConstructorsConstructorDescriptionDelegatingSecurityContextTaskScheduler(org.springframework.scheduling.TaskScheduler delegate) Creates a newDelegatingSecurityContextTaskSchedulerthat uses the currentSecurityContextfrom theSecurityContextHolder.DelegatingSecurityContextTaskScheduler(org.springframework.scheduling.TaskScheduler delegateTaskScheduler, @Nullable SecurityContext securityContext) Creates a newDelegatingSecurityContextTaskSchedulerthat uses the specifiedSecurityContext.
- 
Method SummaryModifier and TypeMethodDescriptiongetClock()@Nullable ScheduledFuture<?>scheduleAtFixedRate(Runnable task, long period) scheduleAtFixedRate(Runnable task, Duration period) scheduleAtFixedRate(Runnable task, Instant startTime, Duration period) scheduleAtFixedRate(Runnable task, Date startTime, long period) scheduleWithFixedDelay(Runnable task, long delay) scheduleWithFixedDelay(Runnable task, Duration delay) scheduleWithFixedDelay(Runnable task, Instant startTime, Duration delay) scheduleWithFixedDelay(Runnable task, Date startTime, long delay) 
- 
Constructor Details- 
DelegatingSecurityContextTaskSchedulerpublic DelegatingSecurityContextTaskScheduler(org.springframework.scheduling.TaskScheduler delegateTaskScheduler, @Nullable SecurityContext securityContext) Creates a newDelegatingSecurityContextTaskSchedulerthat uses the specifiedSecurityContext.- Parameters:
- delegateTaskScheduler- the- TaskSchedulerto delegate to. Cannot be null.
- securityContext- the- SecurityContextto use for each- DelegatingSecurityContextRunnableor null to default to the current- SecurityContext
- Since:
- 5.6
 
- 
DelegatingSecurityContextTaskSchedulerpublic DelegatingSecurityContextTaskScheduler(org.springframework.scheduling.TaskScheduler delegate) Creates a newDelegatingSecurityContextTaskSchedulerthat uses the currentSecurityContextfrom theSecurityContextHolder.- Parameters:
- delegate- the- TaskExecutorto delegate to. Cannot be null.
 
 
- 
- 
Method Details- 
schedulepublic @Nullable ScheduledFuture<?> schedule(Runnable task, org.springframework.scheduling.Trigger trigger) - Specified by:
- schedulein interface- org.springframework.scheduling.TaskScheduler
 
- 
schedule- Specified by:
- schedulein interface- org.springframework.scheduling.TaskScheduler
 
- 
scheduleAtFixedRate- Specified by:
- scheduleAtFixedRatein interface- org.springframework.scheduling.TaskScheduler
 
- 
scheduleAtFixedRate- Specified by:
- scheduleAtFixedRatein interface- org.springframework.scheduling.TaskScheduler
 
- 
scheduleWithFixedDelay- Specified by:
- scheduleWithFixedDelayin interface- org.springframework.scheduling.TaskScheduler
 
- 
scheduleWithFixedDelay- Specified by:
- scheduleWithFixedDelayin interface- org.springframework.scheduling.TaskScheduler
 
- 
schedule- Specified by:
- schedulein interface- org.springframework.scheduling.TaskScheduler
 
- 
scheduleAtFixedRate- Specified by:
- scheduleAtFixedRatein interface- org.springframework.scheduling.TaskScheduler
 
- 
scheduleAtFixedRate- Specified by:
- scheduleAtFixedRatein interface- org.springframework.scheduling.TaskScheduler
 
- 
scheduleWithFixedDelay- Specified by:
- scheduleWithFixedDelayin interface- org.springframework.scheduling.TaskScheduler
 
- 
scheduleWithFixedDelay- Specified by:
- scheduleWithFixedDelayin interface- org.springframework.scheduling.TaskScheduler
 
- 
getClock- Specified by:
- getClockin interface- org.springframework.scheduling.TaskScheduler
 
 
-