Class DelegatingSecurityContextExecutor
java.lang.Object
org.springframework.security.concurrent.DelegatingSecurityContextExecutor
- All Implemented Interfaces:
Executor
- Direct Known Subclasses:
DelegatingSecurityContextExecutorService
,DelegatingSecurityContextTaskExecutor
- Since:
- 3.2
-
Constructor Summary
ConstructorDescriptionDelegatingSecurityContextExecutor
(Executor delegate) Creates a newDelegatingSecurityContextExecutor
that uses the currentSecurityContext
from theSecurityContextHolder
at the time the task is submitted.DelegatingSecurityContextExecutor
(Executor delegateExecutor, SecurityContext securityContext) Creates a newDelegatingSecurityContextExecutor
that uses the specifiedSecurityContext
. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
protected final Executor
void
setSecurityContextHolderStrategy
(SecurityContextHolderStrategy securityContextHolderStrategy) Sets theSecurityContextHolderStrategy
to use.protected final Runnable
protected final <T> Callable<T>
-
Constructor Details
-
DelegatingSecurityContextExecutor
public DelegatingSecurityContextExecutor(Executor delegateExecutor, SecurityContext securityContext) Creates a newDelegatingSecurityContextExecutor
that uses the specifiedSecurityContext
.- Parameters:
delegateExecutor
- theExecutor
to delegate to. Cannot be null.securityContext
- theSecurityContext
to use for eachDelegatingSecurityContextRunnable
or null to default to the currentSecurityContext
-
DelegatingSecurityContextExecutor
Creates a newDelegatingSecurityContextExecutor
that uses the currentSecurityContext
from theSecurityContextHolder
at the time the task is submitted.- Parameters:
delegate
- theExecutor
to delegate to. Cannot be null.
-
-
Method Details
-
execute
-
getDelegateExecutor
-
setSecurityContextHolderStrategy
public void setSecurityContextHolderStrategy(SecurityContextHolderStrategy securityContextHolderStrategy) Sets theSecurityContextHolderStrategy
to use. The default action is to use theSecurityContextHolderStrategy
stored inSecurityContextHolder
.- Since:
- 5.8
-
wrap
-
wrap
-