org.springframework.security.concurrent
Class DelegatingSecurityContextExecutor
java.lang.Object
org.springframework.security.concurrent.DelegatingSecurityContextExecutor
- All Implemented Interfaces:
- Executor
- Direct Known Subclasses:
- DelegatingSecurityContextExecutorService, DelegatingSecurityContextTaskExecutor
public class DelegatingSecurityContextExecutor
- extends Object
- implements Executor
An Executor which wraps each Runnable in a DelegatingSecurityContextRunnable.
- Since:
- 3.2
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DelegatingSecurityContextExecutor
public DelegatingSecurityContextExecutor(Executor delegateExecutor,
SecurityContext securityContext)
- Creates a new
DelegatingSecurityContextExecutor that uses the specified SecurityContext.
- Parameters:
delegateExecutor - the Executor to delegate to. Cannot be null.securityContext - the SecurityContext to use for each DelegatingSecurityContextRunnable or
null to default to the current SecurityContext
DelegatingSecurityContextExecutor
public DelegatingSecurityContextExecutor(Executor delegate)
- Creates a new
DelegatingSecurityContextExecutor that uses the current SecurityContext from the
SecurityContextHolder at the time the task is submitted.
- Parameters:
delegate - the Executor to delegate to. Cannot be null.
execute
public final void execute(Runnable task)
- Specified by:
execute in interface Executor
getDelegateExecutor
protected final Executor getDelegateExecutor()
wrap
protected final Runnable wrap(Runnable delegate)
wrap
protected final <T> Callable<T> wrap(Callable<T> delegate)