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 TypeMethodDescriptiongetClock()
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, 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
-
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
-
getClock
- Specified by:
getClock
in interfaceorg.springframework.scheduling.TaskScheduler
-