Java 类org.springframework.web.context.request.async.DeferredResultProcessingInterceptorAdapter 实例源码

项目:ait-platform    文件:AitWebMvcConfigurerAdapter.java   
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
    // initial timeout
    configurer.setDefaultTimeout(6000);

    configurer.registerDeferredResultInterceptors(new DeferredResultProcessingInterceptorAdapter() {
        @Override
        public <T> boolean handleTimeout(NativeWebRequest req, DeferredResult<T> result) {
            return result.setErrorResult(new DiscoveryAsyncTimeoutException());
        }
    });
}
项目:ait-platform    文件:AitWebMvcConfigurerAdapter.java   
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
    // initial timeout
    configurer.setDefaultTimeout(6000);

    configurer.registerDeferredResultInterceptors(new DeferredResultProcessingInterceptorAdapter() {
        @Override
        public <T> boolean handleTimeout(NativeWebRequest req, DeferredResult<T> result) {
            return result.setErrorResult(new DiscoveryAsyncTimeoutException());
        }
    });
}
项目:ait-platform    文件:AitWebMvcConfigurerAdapter.java   
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
    // initial timeout
    configurer.setDefaultTimeout(6000);

    configurer.registerDeferredResultInterceptors(new DeferredResultProcessingInterceptorAdapter() {
        @Override
        public <T> boolean handleTimeout(NativeWebRequest req, DeferredResult<T> result) {
            return result.setErrorResult(new DiscoveryAsyncTimeoutException());
        }
    });
}
项目:wiredtigervsvmap    文件:WebConfiguration.java   
@Override
public void configureAsyncSupport(final AsyncSupportConfigurer configurer) {
    configurer.registerDeferredResultInterceptors(
        new DeferredResultProcessingInterceptorAdapter() {
            @Override
            public <T> boolean handleTimeout(final NativeWebRequest request, final DeferredResult<T> result) {
                log.error("timeout request...");
                result.setErrorResult(new RuntimeException());
                return false;
            }
        });
}
项目:spring4-understanding    文件:WebMvcConfigurationSupportExtensionTests.java   
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
    configurer.setDefaultTimeout(2500).setTaskExecutor(new ConcurrentTaskExecutor())
        .registerCallableInterceptors(new CallableProcessingInterceptorAdapter() { })
        .registerDeferredResultInterceptors(new DeferredResultProcessingInterceptorAdapter() {});
}
项目:class-guard    文件:WebMvcConfigurationSupportExtensionTests.java   
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
    configurer.setDefaultTimeout(2500).setTaskExecutor(new ConcurrentTaskExecutor())
        .registerCallableInterceptors(new CallableProcessingInterceptorAdapter() { })
        .registerDeferredResultInterceptors(new DeferredResultProcessingInterceptorAdapter() {});
}