org.springframework.security.task
Class DelegatingSecurityContextAsyncTaskExecutor

java.lang.Object
  extended by org.springframework.security.concurrent.DelegatingSecurityContextExecutor
      extended by org.springframework.security.task.DelegatingSecurityContextTaskExecutor
          extended by 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

Field Summary
 
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
 
Constructor Summary
DelegatingSecurityContextAsyncTaskExecutor(AsyncTaskExecutor delegateAsyncTaskExecutor)
          Creates a new DelegatingSecurityContextAsyncTaskExecutor that uses the current SecurityContext.
DelegatingSecurityContextAsyncTaskExecutor(AsyncTaskExecutor delegateAsyncTaskExecutor, SecurityContext securityContext)
          Creates a new DelegatingSecurityContextAsyncTaskExecutor that uses the specified SecurityContext.
 
Method Summary
 void execute(Runnable task, long startTimeout)
           
<T> Future<T>
submit(Callable<T> task)
           
 Future<?> submit(Runnable task)
           
protected
<T> Callable<T>
wrap(Callable<T> delegate)
           
protected  Runnable wrap(Runnable delegate)
           
 
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 org.springframework.core.task.TaskExecutor
execute
 

Constructor Detail

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.
Method Detail

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)