org.springframework.security.concurrent
Class DelegatingSecurityContextExecutorService
java.lang.Object
org.springframework.security.concurrent.DelegatingSecurityContextExecutor
org.springframework.security.concurrent.DelegatingSecurityContextExecutorService
- All Implemented Interfaces:
- Executor, ExecutorService
- Direct Known Subclasses:
- DelegatingSecurityContextScheduledExecutorService
public class DelegatingSecurityContextExecutorService
- extends DelegatingSecurityContextExecutor
- implements ExecutorService
An ExecutorService
which wraps each Runnable
in a DelegatingSecurityContextRunnable
and each
Callable
in a DelegatingSecurityContextCallable
.
- Since:
- 3.2
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DelegatingSecurityContextExecutorService
public DelegatingSecurityContextExecutorService(ExecutorService delegateExecutorService,
SecurityContext securityContext)
- Creates a new
DelegatingSecurityContextExecutorService
that uses the specified SecurityContext
.
- Parameters:
delegateExecutorService
- the ExecutorService
to delegate to. Cannot be null.securityContext
- the SecurityContext
to use for each DelegatingSecurityContextRunnable
and
each DelegatingSecurityContextCallable
.
DelegatingSecurityContextExecutorService
public DelegatingSecurityContextExecutorService(ExecutorService delegate)
- Creates a new
DelegatingSecurityContextExecutorService
that uses the current SecurityContext
from
the SecurityContextHolder
.
- Parameters:
delegateTaskExecutor
- the TaskExecutor
to delegate to. Cannot be null.
shutdown
public final void shutdown()
- Specified by:
shutdown
in interface ExecutorService
shutdownNow
public final List<Runnable> shutdownNow()
- Specified by:
shutdownNow
in interface ExecutorService
isShutdown
public final boolean isShutdown()
- Specified by:
isShutdown
in interface ExecutorService
isTerminated
public final boolean isTerminated()
- Specified by:
isTerminated
in interface ExecutorService
awaitTermination
public final boolean awaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
- Specified by:
awaitTermination
in interface ExecutorService
- Throws:
InterruptedException
submit
public final <T> Future<T> submit(Callable<T> task)
- Specified by:
submit
in interface ExecutorService
submit
public final <T> Future<T> submit(Runnable task,
T result)
- Specified by:
submit
in interface ExecutorService
submit
public final Future<?> submit(Runnable task)
- Specified by:
submit
in interface ExecutorService
invokeAll
public final List invokeAll(Collection tasks)
throws InterruptedException
- Specified by:
invokeAll
in interface ExecutorService
- Throws:
InterruptedException
invokeAll
public final List invokeAll(Collection tasks,
long timeout,
TimeUnit unit)
throws InterruptedException
- Specified by:
invokeAll
in interface ExecutorService
- Throws:
InterruptedException
invokeAny
public final Object invokeAny(Collection tasks)
throws InterruptedException,
ExecutionException
- Specified by:
invokeAny
in interface ExecutorService
- Throws:
InterruptedException
ExecutionException
invokeAny
public final Object invokeAny(Collection tasks,
long timeout,
TimeUnit unit)
throws InterruptedException,
ExecutionException,
TimeoutException
- Specified by:
invokeAny
in interface ExecutorService
- Throws:
InterruptedException
ExecutionException
TimeoutException
wrap
protected final Runnable wrap(Runnable delegate)
wrap
protected final <T> Callable<T> wrap(Callable<T> delegate)