org.springframework.security.web.context.request.async
Class SecurityContextCallableProcessingInterceptor
java.lang.Object
org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter
org.springframework.security.web.context.request.async.SecurityContextCallableProcessingInterceptor
- All Implemented Interfaces:
- CallableProcessingInterceptor
public final class SecurityContextCallableProcessingInterceptor
- extends CallableProcessingInterceptorAdapter
Allows for integration with Spring MVC's Callable support.
A CallableProcessingInterceptor that establishes the injected SecurityContext on the
SecurityContextHolder when preProcess(NativeWebRequest, Callable) is invoked. It also clear out the
SecurityContextHolder by invoking SecurityContextHolder.clearContext() in the
postProcess(NativeWebRequest, Callable, Object) method.
- Since:
- 3.2
- Author:
- Rob Winch
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SecurityContextCallableProcessingInterceptor
public SecurityContextCallableProcessingInterceptor()
- Create a new
SecurityContextCallableProcessingInterceptor that uses the SecurityContext from the
SecurityContextHolder at the time beforeConcurrentHandling(NativeWebRequest, Callable) is invoked.
SecurityContextCallableProcessingInterceptor
public SecurityContextCallableProcessingInterceptor(org.springframework.security.core.context.SecurityContext securityContext)
- Creates a new
SecurityContextCallableProcessingInterceptor with the specified SecurityContext.
- Parameters:
securityContext - the SecurityContext to set on the SecurityContextHolder in
preProcess(NativeWebRequest, Callable). Cannot be null.
- Throws:
IllegalArgumentException - if SecurityContext is null.
beforeConcurrentHandling
public <T> void beforeConcurrentHandling(NativeWebRequest request,
Callable<T> task)
throws Exception
- Specified by:
beforeConcurrentHandling in interface CallableProcessingInterceptor- Overrides:
beforeConcurrentHandling in class CallableProcessingInterceptorAdapter
- Throws:
Exception
preProcess
public <T> void preProcess(NativeWebRequest request,
Callable<T> task)
throws Exception
- Specified by:
preProcess in interface CallableProcessingInterceptor- Overrides:
preProcess in class CallableProcessingInterceptorAdapter
- Throws:
Exception
postProcess
public <T> void postProcess(NativeWebRequest request,
Callable<T> task,
Object concurrentResult)
throws Exception
- Specified by:
postProcess in interface CallableProcessingInterceptor- Overrides:
postProcess in class CallableProcessingInterceptorAdapter
- Throws:
Exception