Class DelegatingSecurityContextTaskScheduler
- java.lang.Object
-
- org.springframework.security.scheduling.DelegatingSecurityContextTaskScheduler
-
- All Implemented Interfaces:
org.springframework.scheduling.TaskScheduler
public class DelegatingSecurityContextTaskScheduler extends java.lang.Object implements org.springframework.scheduling.TaskScheduler
An implementation ofTaskScheduler
invoking it whenever the trigger indicates a next execution time.- Since:
- 5.1
-
-
Constructor Summary
Constructors Constructor Description DelegatingSecurityContextTaskScheduler(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.ScheduledFuture<?>
schedule(java.lang.Runnable task, java.util.Date startTime)
java.util.concurrent.ScheduledFuture<?>
schedule(java.lang.Runnable task, org.springframework.scheduling.Trigger trigger)
java.util.concurrent.ScheduledFuture<?>
scheduleAtFixedRate(java.lang.Runnable task, long period)
java.util.concurrent.ScheduledFuture<?>
scheduleAtFixedRate(java.lang.Runnable task, java.util.Date startTime, long period)
java.util.concurrent.ScheduledFuture<?>
scheduleWithFixedDelay(java.lang.Runnable task, long delay)
java.util.concurrent.ScheduledFuture<?>
scheduleWithFixedDelay(java.lang.Runnable task, java.util.Date startTime, long delay)
-
-
-
Constructor Detail
-
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 Detail
-
schedule
public java.util.concurrent.ScheduledFuture<?> schedule(java.lang.Runnable task, org.springframework.scheduling.Trigger trigger)
- Specified by:
schedule
in interfaceorg.springframework.scheduling.TaskScheduler
-
schedule
public java.util.concurrent.ScheduledFuture<?> schedule(java.lang.Runnable task, java.util.Date startTime)
- Specified by:
schedule
in interfaceorg.springframework.scheduling.TaskScheduler
-
scheduleAtFixedRate
public java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable task, java.util.Date startTime, long period)
- Specified by:
scheduleAtFixedRate
in interfaceorg.springframework.scheduling.TaskScheduler
-
scheduleAtFixedRate
public java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable task, long period)
- Specified by:
scheduleAtFixedRate
in interfaceorg.springframework.scheduling.TaskScheduler
-
scheduleWithFixedDelay
public java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable task, java.util.Date startTime, long delay)
- Specified by:
scheduleWithFixedDelay
in interfaceorg.springframework.scheduling.TaskScheduler
-
scheduleWithFixedDelay
public java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable task, long delay)
- Specified by:
scheduleWithFixedDelay
in interfaceorg.springframework.scheduling.TaskScheduler
-
-