org.springframework.security.task
Class DelegatingSecurityContextTaskExecutor

java.lang.Object
  extended by org.springframework.security.concurrent.DelegatingSecurityContextExecutor
      extended by org.springframework.security.task.DelegatingSecurityContextTaskExecutor
All Implemented Interfaces:
Executor, TaskExecutor
Direct Known Subclasses:
DelegatingSecurityContextAsyncTaskExecutor

public class DelegatingSecurityContextTaskExecutor
extends DelegatingSecurityContextExecutor
implements TaskExecutor

An TaskExecutor which wraps each Runnable in a DelegatingSecurityContextRunnable.

Since:
3.2

Constructor Summary
DelegatingSecurityContextTaskExecutor(TaskExecutor delegate)
          Creates a new DelegatingSecurityContextTaskExecutor that uses the current SecurityContext from the SecurityContextHolder.
DelegatingSecurityContextTaskExecutor(TaskExecutor delegateTaskExecutor, SecurityContext securityContext)
          Creates a new DelegatingSecurityContextTaskExecutor that uses the specified SecurityContext.
 
Method Summary
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

DelegatingSecurityContextTaskExecutor

public DelegatingSecurityContextTaskExecutor(TaskExecutor delegateTaskExecutor,
                                             SecurityContext securityContext)
Creates a new DelegatingSecurityContextTaskExecutor that uses the specified SecurityContext.

Parameters:
delegateTaskExecutor - the TaskExecutor to delegate to. Cannot be null.
securityContext - the SecurityContext to use for each DelegatingSecurityContextRunnable

DelegatingSecurityContextTaskExecutor

public DelegatingSecurityContextTaskExecutor(TaskExecutor delegate)
Creates a new DelegatingSecurityContextTaskExecutor that uses the current SecurityContext from the SecurityContextHolder.

Parameters:
delegateTaskExecutor - the TaskExecutor to delegate to. Cannot be null.
Method Detail

wrap

protected final Runnable wrap(Runnable delegate)

wrap

protected final <T> Callable<T> wrap(Callable<T> delegate)