Class DelegatingSecurityContextAsyncTaskExecutor
- java.lang.Object
-
- org.springframework.security.concurrent.DelegatingSecurityContextExecutor
-
- org.springframework.security.task.DelegatingSecurityContextTaskExecutor
-
- org.springframework.security.task.DelegatingSecurityContextAsyncTaskExecutor
-
- All Implemented Interfaces:
java.util.concurrent.Executor
,org.springframework.core.task.AsyncTaskExecutor
,org.springframework.core.task.TaskExecutor
- Direct Known Subclasses:
DelegatingSecurityContextSchedulingTaskExecutor
public class DelegatingSecurityContextAsyncTaskExecutor extends DelegatingSecurityContextTaskExecutor implements org.springframework.core.task.AsyncTaskExecutor
AnAsyncTaskExecutor
which wraps eachRunnable
in aDelegatingSecurityContextRunnable
and eachCallable
in aDelegatingSecurityContextCallable
.- Since:
- 3.2
-
-
Constructor Summary
Constructors Constructor Description DelegatingSecurityContextAsyncTaskExecutor(org.springframework.core.task.AsyncTaskExecutor delegateAsyncTaskExecutor)
Creates a newDelegatingSecurityContextAsyncTaskExecutor
that uses the currentSecurityContext
.DelegatingSecurityContextAsyncTaskExecutor(org.springframework.core.task.AsyncTaskExecutor delegateAsyncTaskExecutor, SecurityContext securityContext)
Creates a newDelegatingSecurityContextAsyncTaskExecutor
that uses the specifiedSecurityContext
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(java.lang.Runnable task, long startTimeout)
java.util.concurrent.Future<?>
submit(java.lang.Runnable task)
<T> java.util.concurrent.Future<T>
submit(java.util.concurrent.Callable<T> task)
protected java.lang.Runnable
wrap(java.lang.Runnable delegate)
protected <T> java.util.concurrent.Callable<T>
wrap(java.util.concurrent.Callable<T> delegate)
-
Methods inherited from class org.springframework.security.concurrent.DelegatingSecurityContextExecutor
execute, getDelegateExecutor, setSecurityContextHolderStrategy
-
-
-
-
Constructor Detail
-
DelegatingSecurityContextAsyncTaskExecutor
public DelegatingSecurityContextAsyncTaskExecutor(org.springframework.core.task.AsyncTaskExecutor delegateAsyncTaskExecutor, SecurityContext securityContext)
Creates a newDelegatingSecurityContextAsyncTaskExecutor
that uses the specifiedSecurityContext
.- Parameters:
delegateAsyncTaskExecutor
- theAsyncTaskExecutor
to delegate to. Cannot be null.securityContext
- theSecurityContext
to use for eachDelegatingSecurityContextRunnable
andDelegatingSecurityContextCallable
-
DelegatingSecurityContextAsyncTaskExecutor
public DelegatingSecurityContextAsyncTaskExecutor(org.springframework.core.task.AsyncTaskExecutor delegateAsyncTaskExecutor)
Creates a newDelegatingSecurityContextAsyncTaskExecutor
that uses the currentSecurityContext
.- Parameters:
delegateAsyncTaskExecutor
- theAsyncTaskExecutor
to delegate to. Cannot be null.
-
-
Method Detail
-
execute
public final void execute(java.lang.Runnable task, long startTimeout)
- Specified by:
execute
in interfaceorg.springframework.core.task.AsyncTaskExecutor
-
submit
public final java.util.concurrent.Future<?> submit(java.lang.Runnable task)
- Specified by:
submit
in interfaceorg.springframework.core.task.AsyncTaskExecutor
-
submit
public final <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
- Specified by:
submit
in interfaceorg.springframework.core.task.AsyncTaskExecutor
-
wrap
protected final java.lang.Runnable wrap(java.lang.Runnable delegate)
-
wrap
protected final <T> java.util.concurrent.Callable<T> wrap(java.util.concurrent.Callable<T> delegate)
-
-