本文整理汇总了Java中org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer.setTaskExecutor方法的典型用法代码示例。如果您正苦于以下问题:Java AsyncSupportConfigurer.setTaskExecutor方法的具体用法?Java AsyncSupportConfigurer.setTaskExecutor怎么用?Java AsyncSupportConfigurer.setTaskExecutor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer
的用法示例。
在下文中一共展示了AsyncSupportConfigurer.setTaskExecutor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureAsyncSupport
import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; //导入方法依赖的package包/类
@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);
}
示例2: webMvcConfigurerAdapter
import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; //导入方法依赖的package包/类
@Bean
public WebMvcConfigurerAdapter webMvcConfigurerAdapter(AsyncTaskExecutor asyncTaskExecutor) {
return new WebMvcConfigurerAdapter() {
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
configurer.setTaskExecutor(asyncTaskExecutor);
super.configureAsyncSupport(configurer);
}
};
}
示例3: configureAsyncSupport
import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; //导入方法依赖的package包/类
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer){
if(asyncTaskExecutor!=null){
configurer.setTaskExecutor(asyncTaskExecutor);
}
if(mvcAsyncProperties!=null){
configurer.setDefaultTimeout(mvcAsyncProperties.getTimeout());
}
}
示例4: configureAsyncSupport
import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; //导入方法依赖的package包/类
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
configurer.setDefaultTimeout(-1);
configurer.setTaskExecutor(asyncTaskExecutor());
}
示例5: configureAsyncSupport
import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; //导入方法依赖的package包/类
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
configurer.setTaskExecutor(getAsyncExecutor());
}
示例6: configureAsyncSupport
import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; //导入方法依赖的package包/类
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
configurer.setTaskExecutor(new SimpleAsyncTaskExecutor());
}