public class DelegatingSecurityContextExecutor
extends java.lang.Object
implements java.util.concurrent.Executor
Constructor and Description |
---|
DelegatingSecurityContextExecutor(java.util.concurrent.Executor delegate)
Creates a new
DelegatingSecurityContextExecutor that uses the current
SecurityContext from the SecurityContextHolder at the time the task
is submitted. |
DelegatingSecurityContextExecutor(java.util.concurrent.Executor delegateExecutor,
SecurityContext securityContext)
Creates a new
DelegatingSecurityContextExecutor that uses the specified
SecurityContext . |
Modifier and Type | Method and Description |
---|---|
void |
execute(java.lang.Runnable task) |
protected java.util.concurrent.Executor |
getDelegateExecutor() |
protected <T> java.util.concurrent.Callable<T> |
wrap(java.util.concurrent.Callable<T> delegate) |
protected java.lang.Runnable |
wrap(java.lang.Runnable delegate) |
public DelegatingSecurityContextExecutor(java.util.concurrent.Executor delegateExecutor, SecurityContext securityContext)
DelegatingSecurityContextExecutor
that uses the specified
SecurityContext
.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
public DelegatingSecurityContextExecutor(java.util.concurrent.Executor delegate)
DelegatingSecurityContextExecutor
that uses the current
SecurityContext
from the SecurityContextHolder
at the time the task
is submitted.delegate
- the Executor
to delegate to. Cannot be null.public final void execute(java.lang.Runnable task)
execute
in interface java.util.concurrent.Executor
protected final java.util.concurrent.Executor getDelegateExecutor()
protected final java.lang.Runnable wrap(java.lang.Runnable delegate)
protected final <T> java.util.concurrent.Callable<T> wrap(java.util.concurrent.Callable<T> delegate)