Java 类org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer 实例源码

项目:setra    文件:WebConfig.java   
@Override
public void configureAsyncSupport(final AsyncSupportConfigurer configurer) {
    final ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(2);
    executor.setMaxPoolSize(2);
    executor.setQueueCapacity(DOWNLOAD_QUEUE_SIZE);
    executor.setThreadNamePrefix("AsyncTaskExecutor-");
    executor.initialize();
    configurer.setTaskExecutor(executor);
}
项目: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;
            }
        });
}
项目:service-integration-sdk    文件:AsyncServletConfiguration.java   
@Bean
public WebMvcConfigurerAdapter webMvcConfigurerAdapter(AsyncTaskExecutor asyncTaskExecutor) {
    return new WebMvcConfigurerAdapter() {
        @Override
        public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
            configurer.setTaskExecutor(asyncTaskExecutor);
            super.configureAsyncSupport(configurer);
        }
    };
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:WebMvcAutoConfiguration.java   
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
    Long timeout = this.mvcProperties.getAsync().getRequestTimeout();
    if (timeout != null) {
        configurer.setDefaultTimeout(timeout);
    }
}
项目:spring-boot-concourse    文件:WebMvcAutoConfiguration.java   
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
    Long timeout = this.mvcProperties.getAsync().getRequestTimeout();
    if (timeout != null) {
        configurer.setDefaultTimeout(timeout);
    }
}
项目:contestparser    文件:WebMvcAutoConfiguration.java   
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
    Long timeout = this.mvcProperties.getAsync().getRequestTimeout();
    if (timeout != null) {
        configurer.setDefaultTimeout(timeout);
    }
}
项目:onetwo    文件:BootMvcConfigurerAdapter.java   
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer){
    if(asyncTaskExecutor!=null){
        configurer.setTaskExecutor(asyncTaskExecutor);
    }
    if(mvcAsyncProperties!=null){
        configurer.setDefaultTimeout(mvcAsyncProperties.getTimeout());
    }
}
项目:spring4-understanding    文件:StandaloneMockMvcBuilder.java   
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
    if (asyncRequestTimeout != null) {
        configurer.setDefaultTimeout(asyncRequestTimeout);
    }
}
项目:spring4-understanding    文件:AsyncControllerJavaConfigTests.java   
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
    configurer.registerCallableInterceptors(callableInterceptor());
}
项目:wonderjameeee    文件:WebConfig.java   
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
    configurer.setDefaultTimeout(-1);
    configurer.setTaskExecutor(asyncTaskExecutor());
}
项目:nio-multipart    文件:WebConfig.java   
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
    configurer.registerDeferredResultInterceptors(new ReadListenerDeferredResultProcessingInterceptor());
}
项目:nakadi    文件:WebConfig.java   
@Override
public void configureAsyncSupport(final AsyncSupportConfigurer configurer) {
    configurer.setDefaultTimeout(nakadiStreamTimeout);
    configurer.registerCallableInterceptors(timeoutInterceptor());
}
项目:spring-project-template    文件:WebConfig.java   
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
    configurer.setTaskExecutor(getAsyncExecutor());
}
项目:class-guard    文件:StandaloneMockMvcBuilder.java   
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
    if (asyncRequestTimeout != null) {
        configurer.setDefaultTimeout(asyncRequestTimeout);
    }
}
项目:spring-responseentitybuilder    文件:WebConfig.java   
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
    configurer.setTaskExecutor(new SimpleAsyncTaskExecutor());
}