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
ConstructorDescriptionDelegatingSecurityContextTaskScheduler
(org.springframework.scheduling.TaskScheduler delegate) Creates a newDelegatingSecurityContextTaskScheduler
that uses the currentSecurityContext
from theSecurityContextHolder
.DelegatingSecurityContextTaskScheduler
(org.springframework.scheduling.TaskScheduler delegateTaskScheduler, SecurityContext securityContext) Creates a newDelegatingSecurityContextTaskScheduler
that 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, wait
Methods 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 newDelegatingSecurityContextTaskScheduler
that uses the specifiedSecurityContext
.- Parameters:
delegateTaskScheduler
- theTaskScheduler
to delegate to. Cannot be null.securityContext
- theSecurityContext
to use for eachDelegatingSecurityContextRunnable
or null to default to the currentSecurityContext
- Since:
- 5.6
-
DelegatingSecurityContextTaskScheduler
public DelegatingSecurityContextTaskScheduler(org.springframework.scheduling.TaskScheduler delegate) Creates a newDelegatingSecurityContextTaskScheduler
that uses the currentSecurityContext
from theSecurityContextHolder
.- Parameters:
delegate
- theTaskExecutor
to delegate to. Cannot be null.
-
-
Method Details
-
schedule
- Specified by:
schedule
in interfaceorg.springframework.scheduling.TaskScheduler
-
schedule
- Specified by:
schedule
in interfaceorg.springframework.scheduling.TaskScheduler
-
scheduleAtFixedRate
- Specified by:
scheduleAtFixedRate
in interfaceorg.springframework.scheduling.TaskScheduler
-
scheduleAtFixedRate
- Specified by:
scheduleAtFixedRate
in interfaceorg.springframework.scheduling.TaskScheduler
-
scheduleWithFixedDelay
- Specified by:
scheduleWithFixedDelay
in interfaceorg.springframework.scheduling.TaskScheduler
-
scheduleWithFixedDelay
- Specified by:
scheduleWithFixedDelay
in interfaceorg.springframework.scheduling.TaskScheduler
-