public class DelegatingSecurityContextExecutorService extends DelegatingSecurityContextExecutor implements java.util.concurrent.ExecutorService
ExecutorService
which wraps each Runnable
in a
DelegatingSecurityContextRunnable
and each Callable
in a
DelegatingSecurityContextCallable
.Constructor and Description |
---|
DelegatingSecurityContextExecutorService(java.util.concurrent.ExecutorService delegate)
Creates a new
DelegatingSecurityContextExecutorService that uses the
current SecurityContext from the SecurityContextHolder . |
DelegatingSecurityContextExecutorService(java.util.concurrent.ExecutorService delegateExecutorService,
SecurityContext securityContext)
Creates a new
DelegatingSecurityContextExecutorService that uses the
specified SecurityContext . |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit) |
java.util.List |
invokeAll(java.util.Collection tasks) |
java.util.List |
invokeAll(java.util.Collection tasks,
long timeout,
java.util.concurrent.TimeUnit unit) |
java.lang.Object |
invokeAny(java.util.Collection tasks) |
java.lang.Object |
invokeAny(java.util.Collection tasks,
long timeout,
java.util.concurrent.TimeUnit unit) |
boolean |
isShutdown() |
boolean |
isTerminated() |
void |
shutdown() |
java.util.List<java.lang.Runnable> |
shutdownNow() |
<T> java.util.concurrent.Future<T> |
submit(java.util.concurrent.Callable<T> task) |
java.util.concurrent.Future<?> |
submit(java.lang.Runnable task) |
<T> java.util.concurrent.Future<T> |
submit(java.lang.Runnable task,
T result) |
protected <T> java.util.concurrent.Callable<T> |
wrap(java.util.concurrent.Callable<T> delegate) |
protected java.lang.Runnable |
wrap(java.lang.Runnable delegate) |
execute, getDelegateExecutor
public DelegatingSecurityContextExecutorService(java.util.concurrent.ExecutorService delegateExecutorService, SecurityContext securityContext)
DelegatingSecurityContextExecutorService
that uses the
specified SecurityContext
.delegateExecutorService
- the ExecutorService
to delegate to. Cannot
be null.securityContext
- the SecurityContext
to use for each
DelegatingSecurityContextRunnable
and each
DelegatingSecurityContextCallable
.public DelegatingSecurityContextExecutorService(java.util.concurrent.ExecutorService delegate)
DelegatingSecurityContextExecutorService
that uses the
current SecurityContext
from the SecurityContextHolder
.delegate
- the ExecutorService
to delegate to. Cannot be null.public final void shutdown()
shutdown
in interface java.util.concurrent.ExecutorService
public final java.util.List<java.lang.Runnable> shutdownNow()
shutdownNow
in interface java.util.concurrent.ExecutorService
public final boolean isShutdown()
isShutdown
in interface java.util.concurrent.ExecutorService
public final boolean isTerminated()
isTerminated
in interface java.util.concurrent.ExecutorService
public final boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
awaitTermination
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
public final <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
submit
in interface java.util.concurrent.ExecutorService
public final <T> java.util.concurrent.Future<T> submit(java.lang.Runnable task, T result)
submit
in interface java.util.concurrent.ExecutorService
public final java.util.concurrent.Future<?> submit(java.lang.Runnable task)
submit
in interface java.util.concurrent.ExecutorService
public final java.util.List invokeAll(java.util.Collection tasks) throws java.lang.InterruptedException
invokeAll
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
public final java.util.List invokeAll(java.util.Collection tasks, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
invokeAll
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
public final java.lang.Object invokeAny(java.util.Collection tasks) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
invokeAny
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public final java.lang.Object invokeAny(java.util.Collection tasks, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
invokeAny
in interface java.util.concurrent.ExecutorService
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
protected final java.lang.Runnable wrap(java.lang.Runnable delegate)
protected final <T> java.util.concurrent.Callable<T> wrap(java.util.concurrent.Callable<T> delegate)