Class DelegatingSecurityContextScheduledExecutorService
java.lang.Object
org.springframework.security.concurrent.DelegatingSecurityContextExecutor
org.springframework.security.concurrent.DelegatingSecurityContextExecutorService
org.springframework.security.concurrent.DelegatingSecurityContextScheduledExecutorService
- All Implemented Interfaces:
Executor
,ExecutorService
,ScheduledExecutorService
public final class DelegatingSecurityContextScheduledExecutorService
extends DelegatingSecurityContextExecutorService
implements ScheduledExecutorService
An
ScheduledExecutorService
which wraps each Runnable
in a
DelegatingSecurityContextRunnable
and each Callable
in a
DelegatingSecurityContextCallable
.- Since:
- 3.2
-
Constructor Summary
ConstructorDescriptionCreates a newDelegatingSecurityContextScheduledExecutorService
that uses the currentSecurityContext
from theSecurityContextHolder
.DelegatingSecurityContextScheduledExecutorService
(ScheduledExecutorService delegateScheduledExecutorService, SecurityContext securityContext) Creates a newDelegatingSecurityContextScheduledExecutorService
that uses the specifiedSecurityContext
. -
Method Summary
Modifier and TypeMethodDescription<V> ScheduledFuture<V>
scheduleAtFixedRate
(Runnable command, long initialDelay, long period, TimeUnit unit) scheduleWithFixedDelay
(Runnable command, long initialDelay, long delay, TimeUnit unit) protected final Runnable
protected final <T> Callable<T>
Methods inherited from class org.springframework.security.concurrent.DelegatingSecurityContextExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit
Methods inherited from class org.springframework.security.concurrent.DelegatingSecurityContextExecutor
execute, getDelegateExecutor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit
-
Constructor Details
-
DelegatingSecurityContextScheduledExecutorService
public DelegatingSecurityContextScheduledExecutorService(ScheduledExecutorService delegateScheduledExecutorService, SecurityContext securityContext) Creates a newDelegatingSecurityContextScheduledExecutorService
that uses the specifiedSecurityContext
.- Parameters:
delegateScheduledExecutorService
- theScheduledExecutorService
to delegate to. Cannot be null.securityContext
- theSecurityContext
to use for eachDelegatingSecurityContextRunnable
and eachDelegatingSecurityContextCallable
.
-
DelegatingSecurityContextScheduledExecutorService
Creates a newDelegatingSecurityContextScheduledExecutorService
that uses the currentSecurityContext
from theSecurityContextHolder
.- Parameters:
delegate
- theScheduledExecutorService
to delegate to. Cannot be null.
-
-
Method Details
-
schedule
- Specified by:
schedule
in interfaceScheduledExecutorService
-
schedule
- Specified by:
schedule
in interfaceScheduledExecutorService
-
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) - Specified by:
scheduleAtFixedRate
in interfaceScheduledExecutorService
-
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) - Specified by:
scheduleWithFixedDelay
in interfaceScheduledExecutorService
-
wrap
-
wrap
-