public class DelegatingSecurityContextSchedulingTaskExecutor extends DelegatingSecurityContextAsyncTaskExecutor implements SchedulingTaskExecutor
SchedulingTaskExecutor
which wraps each Runnable
in a
DelegatingSecurityContextRunnable
and each Callable
in a
DelegatingSecurityContextCallable
.TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Constructor and Description |
---|
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 . |
Modifier and Type | Method and Description |
---|---|
boolean |
prefersShortLivedTasks() |
protected <T> Callable<T> |
wrap(Callable<T> delegate) |
protected Runnable |
wrap(Runnable delegate) |
execute, submit, submit
execute, getDelegateExecutor
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute, submit, submit
execute
public DelegatingSecurityContextSchedulingTaskExecutor(SchedulingTaskExecutor delegateSchedulingTaskExecutor, SecurityContext securityContext)
DelegatingSecurityContextSchedulingTaskExecutor
that uses the
specified SecurityContext
.delegateSchedulingTaskExecutor
- the SchedulingTaskExecutor
to
delegate to. Cannot be null.securityContext
- the SecurityContext
to use for each
DelegatingSecurityContextRunnable
and
DelegatingSecurityContextCallable
public DelegatingSecurityContextSchedulingTaskExecutor(SchedulingTaskExecutor delegateAsyncTaskExecutor)
DelegatingSecurityContextSchedulingTaskExecutor
that uses the
current SecurityContext
.delegateAsyncTaskExecutor
- the AsyncTaskExecutor
to delegate to.
Cannot be null.public boolean prefersShortLivedTasks()
prefersShortLivedTasks
in interface SchedulingTaskExecutor