org.springframework.security.task
Class DelegatingSecurityContextAsyncTaskExecutor
java.lang.Object
org.springframework.security.concurrent.DelegatingSecurityContextExecutor
org.springframework.security.task.DelegatingSecurityContextTaskExecutor
org.springframework.security.task.DelegatingSecurityContextAsyncTaskExecutor
- All Implemented Interfaces:
- Executor, AsyncTaskExecutor, TaskExecutor
- Direct Known Subclasses:
- DelegatingSecurityContextSchedulingTaskExecutor
public class DelegatingSecurityContextAsyncTaskExecutor
- extends DelegatingSecurityContextTaskExecutor
- implements AsyncTaskExecutor
An AsyncTaskExecutor
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 |
DelegatingSecurityContextAsyncTaskExecutor
public DelegatingSecurityContextAsyncTaskExecutor(AsyncTaskExecutor delegateAsyncTaskExecutor,
SecurityContext securityContext)
- Creates a new
DelegatingSecurityContextAsyncTaskExecutor
that uses the specified SecurityContext
.
- Parameters:
delegateAsyncTaskExecutor
- the AsyncTaskExecutor
to delegate to. Cannot be null.securityContext
- the SecurityContext
to use for each DelegatingSecurityContextRunnable
and
DelegatingSecurityContextCallable
DelegatingSecurityContextAsyncTaskExecutor
public DelegatingSecurityContextAsyncTaskExecutor(AsyncTaskExecutor delegateAsyncTaskExecutor)
- Creates a new
DelegatingSecurityContextAsyncTaskExecutor
that uses the current SecurityContext
.
- Parameters:
delegateAsyncTaskExecutor
- the AsyncTaskExecutor
to delegate to. Cannot be null.
execute
public final void execute(Runnable task,
long startTimeout)
- Specified by:
execute
in interface AsyncTaskExecutor
submit
public final Future<?> submit(Runnable task)
- Specified by:
submit
in interface AsyncTaskExecutor
submit
public final <T> Future<T> submit(Callable<T> task)
- Specified by:
submit
in interface AsyncTaskExecutor
wrap
protected final Runnable wrap(Runnable delegate)
wrap
protected final <T> Callable<T> wrap(Callable<T> delegate)