Examples of CallableProcessingInterceptorAdapter


Examples of org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter

    }

    @Test
    public void doFilterInternalRegistersSecurityContextCallableProcessor() throws Exception {
        SecurityContextHolder.setContext(securityContext);
        asyncManager.registerCallableInterceptors(new CallableProcessingInterceptorAdapter() {
            @Override
            public <T> void postProcess(NativeWebRequest request, Callable<T> task, Object concurrentResult)
                    throws Exception {
                assertThat(SecurityContextHolder.getContext()).isNotSameAs(securityContext);
            }
View Full Code Here

Examples of org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter

    }

    @Test
    public void doFilterInternalRegistersSecurityContextCallableProcessorContextUpdated() throws Exception {
        SecurityContextHolder.setContext(SecurityContextHolder.createEmptyContext());
        asyncManager.registerCallableInterceptors(new CallableProcessingInterceptorAdapter() {
            @Override
            public <T> void postProcess(NativeWebRequest request, Callable<T> task, Object concurrentResult)
                    throws Exception {
                assertThat(SecurityContextHolder.getContext()).isNotSameAs(securityContext);
            }
View Full Code Here

Examples of org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter

      logger.trace("Cleared thread-bound request context: " + request);
    }
  }

  private CallableProcessingInterceptor getRequestBindingInterceptor(final HttpServletRequest request) {
    return new CallableProcessingInterceptorAdapter() {
      @Override
      public <T> void preProcess(NativeWebRequest webRequest, Callable<T> task) {
        initContextHolders(request, buildLocaleContext(request), new ServletRequestAttributes(request));
      }
      @Override
View Full Code Here

Examples of org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter

    }

    @Override
    public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
      configurer.setDefaultTimeout(2500).setTaskExecutor(new ConcurrentTaskExecutor())
        .registerCallableInterceptors(new CallableProcessingInterceptorAdapter() { })
        .registerDeferredResultInterceptors(new DeferredResultProcessingInterceptorAdapter() {});
    }
View Full Code Here

Examples of org.springframework.web.context.request.async.CallableProcessingInterceptorAdapter

    super.service(request, response);
  }

  private void registerAsyncResultInterceptors(final HttpServletRequest request) {
    WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(request);
    asyncManager.registerCallableInterceptor(KEY, new CallableProcessingInterceptorAdapter() {
      @Override
      public <T> void postProcess(NativeWebRequest r, Callable<T> task, Object value) throws Exception {
        getMvcResult(request).setAsyncResult(value);
      }
    });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.