org.springframework.security.scheduling
Class DelegatingSecurityContextSchedulingTaskExecutor

java.lang.Object
  extended by org.springframework.security.concurrent.DelegatingSecurityContextExecutor
      extended by org.springframework.security.task.DelegatingSecurityContextTaskExecutor
          extended by org.springframework.security.task.DelegatingSecurityContextAsyncTaskExecutor
              extended by org.springframework.security.scheduling.DelegatingSecurityContextSchedulingTaskExecutor
All Implemented Interfaces:
Executor, AsyncTaskExecutor, TaskExecutor, SchedulingTaskExecutor

public class DelegatingSecurityContextSchedulingTaskExecutor
extends DelegatingSecurityContextAsyncTaskExecutor
implements SchedulingTaskExecutor

An SchedulingTaskExecutor 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
DelegatingSecurityContextSchedulingTaskExecutor(SchedulingTaskExecutor delegateAsyncTaskExecutor)
          Creates a new DelegatingSecurityContextSchedulingTaskExecutor that uses the current SecurityContext.
DelegatingSecurityContextSchedulingTaskExecutor(SchedulingTaskExecutor delegateSchedulingTaskExecutor, SecurityContext securityContext)
          Creates a new DelegatingSecurityContextSchedulingTaskExecutor that uses the specified SecurityContext.
 
Method Summary
 boolean prefersShortLivedTasks()
           
protected
<T> Callable<T>
wrap(Callable<T> delegate)
           
protected  Runnable wrap(Runnable delegate)
           
 
Methods inherited from class org.springframework.security.task.DelegatingSecurityContextAsyncTaskExecutor
execute, submit, submit
 
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.AsyncTaskExecutor
execute, submit, submit
 
Methods inherited from interface org.springframework.core.task.TaskExecutor
execute
 

Constructor Detail

DelegatingSecurityContextSchedulingTaskExecutor

public DelegatingSecurityContextSchedulingTaskExecutor(SchedulingTaskExecutor delegateSchedulingTaskExecutor,
                                                       SecurityContext securityContext)
Creates a new DelegatingSecurityContextSchedulingTaskExecutor that uses the specified SecurityContext.

Parameters:
delegateSchedulingTaskExecutor - the SchedulingTaskExecutor to delegate to. Cannot be null.
securityContext - the SecurityContext to use for each DelegatingSecurityContextRunnable and DelegatingSecurityContextCallable

DelegatingSecurityContextSchedulingTaskExecutor

public DelegatingSecurityContextSchedulingTaskExecutor(SchedulingTaskExecutor delegateAsyncTaskExecutor)
Creates a new DelegatingSecurityContextSchedulingTaskExecutor that uses the current SecurityContext.

Parameters:
delegateAsyncTaskExecutor - the AsyncTaskExecutor to delegate to. Cannot be null.
Method Detail

prefersShortLivedTasks

public boolean prefersShortLivedTasks()
Specified by:
prefersShortLivedTasks in interface SchedulingTaskExecutor

wrap

protected final Runnable wrap(Runnable delegate)

wrap

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