Class DelegatingSecurityContextScheduledExecutorService
- java.lang.Object
-
- org.springframework.security.concurrent.DelegatingSecurityContextExecutor
-
- org.springframework.security.concurrent.DelegatingSecurityContextExecutorService
-
- org.springframework.security.concurrent.DelegatingSecurityContextScheduledExecutorService
-
- All Implemented Interfaces:
java.util.concurrent.Executor
,java.util.concurrent.ExecutorService
,java.util.concurrent.ScheduledExecutorService
public final class DelegatingSecurityContextScheduledExecutorService extends DelegatingSecurityContextExecutorService implements java.util.concurrent.ScheduledExecutorService
AnScheduledExecutorService
which wraps eachRunnable
in aDelegatingSecurityContextRunnable
and eachCallable
in aDelegatingSecurityContextCallable
.- Since:
- 3.2
-
-
Constructor Summary
Constructors Constructor Description DelegatingSecurityContextScheduledExecutorService(java.util.concurrent.ScheduledExecutorService delegate)
Creates a newDelegatingSecurityContextScheduledExecutorService
that uses the currentSecurityContext
from theSecurityContextHolder
.DelegatingSecurityContextScheduledExecutorService(java.util.concurrent.ScheduledExecutorService delegateScheduledExecutorService, SecurityContext securityContext)
Creates a newDelegatingSecurityContextScheduledExecutorService
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 command, long delay, java.util.concurrent.TimeUnit unit)
<V> java.util.concurrent.ScheduledFuture<V>
schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit)
java.util.concurrent.ScheduledFuture<?>
scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
java.util.concurrent.ScheduledFuture<?>
scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
protected java.lang.Runnable
wrap(java.lang.Runnable delegate)
protected <T> java.util.concurrent.Callable<T>
wrap(java.util.concurrent.Callable<T> delegate)
-
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, setSecurityContextHolderStrategy
-
-
-
-
Constructor Detail
-
DelegatingSecurityContextScheduledExecutorService
public DelegatingSecurityContextScheduledExecutorService(java.util.concurrent.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
public DelegatingSecurityContextScheduledExecutorService(java.util.concurrent.ScheduledExecutorService delegate)
Creates a newDelegatingSecurityContextScheduledExecutorService
that uses the currentSecurityContext
from theSecurityContextHolder
.- Parameters:
delegate
- theScheduledExecutorService
to delegate to. Cannot be null.
-
-
Method Detail
-
schedule
public java.util.concurrent.ScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
- Specified by:
schedule
in interfacejava.util.concurrent.ScheduledExecutorService
-
schedule
public <V> java.util.concurrent.ScheduledFuture<V> schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit)
- Specified by:
schedule
in interfacejava.util.concurrent.ScheduledExecutorService
-
scheduleAtFixedRate
public java.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
- Specified by:
scheduleAtFixedRate
in interfacejava.util.concurrent.ScheduledExecutorService
-
scheduleWithFixedDelay
public java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
- Specified by:
scheduleWithFixedDelay
in interfacejava.util.concurrent.ScheduledExecutorService
-
wrap
protected final java.lang.Runnable wrap(java.lang.Runnable delegate)
-
wrap
protected final <T> java.util.concurrent.Callable<T> wrap(java.util.concurrent.Callable<T> delegate)
-
-