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
ConstructorsConstructorDescriptionDelegatingSecurityContextTaskScheduler(org.springframework.scheduling.TaskScheduler delegate) Creates a newDelegatingSecurityContextTaskSchedulerthat uses the currentSecurityContextfrom theSecurityContextHolder.DelegatingSecurityContextTaskScheduler(org.springframework.scheduling.TaskScheduler delegateTaskScheduler, SecurityContext securityContext) Creates a newDelegatingSecurityContextTaskSchedulerthat uses the specifiedSecurityContext. -
Method Summary
Modifier and TypeMethodDescriptionscheduleAtFixedRate(Runnable task, long period) scheduleAtFixedRate(Runnable task, Date startTime, long period) scheduleWithFixedDelay(Runnable task, long delay) scheduleWithFixedDelay(Runnable task, Date startTime, long delay) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.scheduling.TaskScheduler
getClock, schedule, scheduleAtFixedRate, scheduleAtFixedRate, scheduleWithFixedDelay, scheduleWithFixedDelay
-
Constructor Details
-
DelegatingSecurityContextTaskScheduler
public DelegatingSecurityContextTaskScheduler(org.springframework.scheduling.TaskScheduler delegateTaskScheduler, SecurityContext securityContext) Creates a newDelegatingSecurityContextTaskSchedulerthat uses the specifiedSecurityContext.- Parameters:
delegateTaskScheduler- theTaskSchedulerto delegate to. Cannot be null.securityContext- theSecurityContextto use for eachDelegatingSecurityContextRunnableor null to default to the currentSecurityContext- Since:
- 5.6
-
DelegatingSecurityContextTaskScheduler
public DelegatingSecurityContextTaskScheduler(org.springframework.scheduling.TaskScheduler delegate) Creates a newDelegatingSecurityContextTaskSchedulerthat uses the currentSecurityContextfrom theSecurityContextHolder.- Parameters:
delegate- theTaskExecutorto delegate to. Cannot be null.
-
-
Method Details
-
schedule
- Specified by:
schedulein interfaceorg.springframework.scheduling.TaskScheduler
-
schedule
- Specified by:
schedulein interfaceorg.springframework.scheduling.TaskScheduler
-
scheduleAtFixedRate
- Specified by:
scheduleAtFixedRatein interfaceorg.springframework.scheduling.TaskScheduler
-
scheduleAtFixedRate
- Specified by:
scheduleAtFixedRatein interfaceorg.springframework.scheduling.TaskScheduler
-
scheduleWithFixedDelay
- Specified by:
scheduleWithFixedDelayin interfaceorg.springframework.scheduling.TaskScheduler
-
scheduleWithFixedDelay
- Specified by:
scheduleWithFixedDelayin interfaceorg.springframework.scheduling.TaskScheduler
-