Class DelegatingSecurityContextSchedulingTaskExecutor
- java.lang.Object
-
- org.springframework.security.concurrent.DelegatingSecurityContextExecutor
-
- org.springframework.security.task.DelegatingSecurityContextTaskExecutor
-
- org.springframework.security.task.DelegatingSecurityContextAsyncTaskExecutor
-
- org.springframework.security.scheduling.DelegatingSecurityContextSchedulingTaskExecutor
-
- All Implemented Interfaces:
java.util.concurrent.Executor
,org.springframework.core.task.AsyncTaskExecutor
,org.springframework.core.task.TaskExecutor
,org.springframework.scheduling.SchedulingTaskExecutor
public class DelegatingSecurityContextSchedulingTaskExecutor extends DelegatingSecurityContextAsyncTaskExecutor implements org.springframework.scheduling.SchedulingTaskExecutor
AnSchedulingTaskExecutor
which wraps eachRunnable
in aDelegatingSecurityContextRunnable
and eachCallable
in aDelegatingSecurityContextCallable
.- Since:
- 3.2
-
-
Constructor Summary
Constructors Constructor Description DelegatingSecurityContextSchedulingTaskExecutor(org.springframework.scheduling.SchedulingTaskExecutor delegateAsyncTaskExecutor)
Creates a newDelegatingSecurityContextSchedulingTaskExecutor
that uses the currentSecurityContext
.DelegatingSecurityContextSchedulingTaskExecutor(org.springframework.scheduling.SchedulingTaskExecutor delegateSchedulingTaskExecutor, SecurityContext securityContext)
Creates a newDelegatingSecurityContextSchedulingTaskExecutor
that uses the specifiedSecurityContext
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
prefersShortLivedTasks()
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.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
-
-
-
-
Constructor Detail
-
DelegatingSecurityContextSchedulingTaskExecutor
public DelegatingSecurityContextSchedulingTaskExecutor(org.springframework.scheduling.SchedulingTaskExecutor delegateSchedulingTaskExecutor, SecurityContext securityContext)
Creates a newDelegatingSecurityContextSchedulingTaskExecutor
that uses the specifiedSecurityContext
.- Parameters:
delegateSchedulingTaskExecutor
- theSchedulingTaskExecutor
to delegate to. Cannot be null.securityContext
- theSecurityContext
to use for eachDelegatingSecurityContextRunnable
andDelegatingSecurityContextCallable
-
DelegatingSecurityContextSchedulingTaskExecutor
public DelegatingSecurityContextSchedulingTaskExecutor(org.springframework.scheduling.SchedulingTaskExecutor delegateAsyncTaskExecutor)
Creates a newDelegatingSecurityContextSchedulingTaskExecutor
that uses the currentSecurityContext
.- Parameters:
delegateAsyncTaskExecutor
- theAsyncTaskExecutor
to delegate to. Cannot be null.
-
-
Method Detail
-
prefersShortLivedTasks
public boolean prefersShortLivedTasks()
- Specified by:
prefersShortLivedTasks
in interfaceorg.springframework.scheduling.SchedulingTaskExecutor
-
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)
-
-