Class SecurityContextCallableProcessingInterceptor

  • All Implemented Interfaces:
    org.springframework.web.context.request.async.CallableProcessingInterceptor

    public final class SecurityContextCallableProcessingInterceptor
    extends org.springframework.web.context.request.async.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
    • Method Detail

      • beforeConcurrentHandling

        public <T> void beforeConcurrentHandling​(org.springframework.web.context.request.NativeWebRequest request,
                                                 java.util.concurrent.Callable<T> task)
        Specified by:
        beforeConcurrentHandling in interface org.springframework.web.context.request.async.CallableProcessingInterceptor
        Overrides:
        beforeConcurrentHandling in class org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter
      • preProcess

        public <T> void preProcess​(org.springframework.web.context.request.NativeWebRequest request,
                                   java.util.concurrent.Callable<T> task)
        Specified by:
        preProcess in interface org.springframework.web.context.request.async.CallableProcessingInterceptor
        Overrides:
        preProcess in class org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter
      • postProcess

        public <T> void postProcess​(org.springframework.web.context.request.NativeWebRequest request,
                                    java.util.concurrent.Callable<T> task,
                                    java.lang.Object concurrentResult)
        Specified by:
        postProcess in interface org.springframework.web.context.request.async.CallableProcessingInterceptor
        Overrides:
        postProcess in class org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter