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.
RESPONSE_HANDLED, RESULT_NONE| Constructor and Description |
|---|
SecurityContextCallableProcessingInterceptor()
Create a new
SecurityContextCallableProcessingInterceptor that uses the SecurityContext from the
SecurityContextHolder at the time beforeConcurrentHandling(NativeWebRequest, Callable) is invoked. |
SecurityContextCallableProcessingInterceptor(org.springframework.security.core.context.SecurityContext securityContext)
Creates a new
SecurityContextCallableProcessingInterceptor with the specified SecurityContext. |
| Modifier and Type | Method and Description |
|---|---|
<T> void |
beforeConcurrentHandling(NativeWebRequest request,
Callable<T> task) |
<T> void |
postProcess(NativeWebRequest request,
Callable<T> task,
Object concurrentResult) |
<T> void |
preProcess(NativeWebRequest request,
Callable<T> task) |
afterCompletion, handleTimeoutpublic SecurityContextCallableProcessingInterceptor()
SecurityContextCallableProcessingInterceptor that uses the SecurityContext from the
SecurityContextHolder at the time beforeConcurrentHandling(NativeWebRequest, Callable) is invoked.public SecurityContextCallableProcessingInterceptor(org.springframework.security.core.context.SecurityContext securityContext)
SecurityContextCallableProcessingInterceptor with the specified SecurityContext.securityContext - the SecurityContext to set on the SecurityContextHolder in
preProcess(NativeWebRequest, Callable). Cannot be null.IllegalArgumentException - if SecurityContext is null.public <T> void beforeConcurrentHandling(NativeWebRequest request, Callable<T> task) throws Exception
beforeConcurrentHandling in interface CallableProcessingInterceptorbeforeConcurrentHandling in class CallableProcessingInterceptorAdapterExceptionpublic <T> void preProcess(NativeWebRequest request, Callable<T> task) throws Exception
preProcess in interface CallableProcessingInterceptorpreProcess in class CallableProcessingInterceptorAdapterExceptionpublic <T> void postProcess(NativeWebRequest request, Callable<T> task, Object concurrentResult) throws Exception
postProcess in interface CallableProcessingInterceptorpostProcess in class CallableProcessingInterceptorAdapterException