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, @Nullable SecurityContext securityContext) Creates a newDelegatingSecurityContextTaskSchedulerthat uses the specifiedSecurityContext. -
Method Summary
Modifier 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
-
DelegatingSecurityContextTaskScheduler
public DelegatingSecurityContextTaskScheduler(org.springframework.scheduling.TaskScheduler delegateTaskScheduler, @Nullable 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
public @Nullable ScheduledFuture<?> schedule(Runnable task, org.springframework.scheduling.Trigger trigger) - 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
-
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
-
getClock
- Specified by:
getClockin interfaceorg.springframework.scheduling.TaskScheduler
-