当前位置: 首页>>代码示例>>Java>>正文


Java AsyncSupportConfigurer.setTaskExecutor方法代码示例

本文整理汇总了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);
}
 
开发者ID:osiegmar,项目名称:setra,代码行数:11,代码来源:WebConfig.java

示例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);
		}
	};
}
 
开发者ID:AppDirect,项目名称:service-integration-sdk,代码行数:11,代码来源:AsyncServletConfiguration.java

示例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());
	}
}
 
开发者ID:wayshall,项目名称:onetwo,代码行数:10,代码来源:BootMvcConfigurerAdapter.java

示例4: configureAsyncSupport

import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; //导入方法依赖的package包/类
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
    configurer.setDefaultTimeout(-1);
    configurer.setTaskExecutor(asyncTaskExecutor());
}
 
开发者ID:lordoftheflies,项目名称:wonderjameeee,代码行数:6,代码来源:WebConfig.java

示例5: configureAsyncSupport

import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; //导入方法依赖的package包/类
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
	configurer.setTaskExecutor(getAsyncExecutor());
}
 
开发者ID:baichenhong,项目名称:spring-project-template,代码行数:5,代码来源:WebConfig.java

示例6: configureAsyncSupport

import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; //导入方法依赖的package包/类
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
	configurer.setTaskExecutor(new SimpleAsyncTaskExecutor());
}
 
开发者ID:patrickvankann,项目名称:spring-responseentitybuilder,代码行数:5,代码来源:WebConfig.java


注:本文中的org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer.setTaskExecutor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。