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


Java AsyncSupportConfigurer类代码示例

本文整理汇总了Java中org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer的典型用法代码示例。如果您正苦于以下问题:Java AsyncSupportConfigurer类的具体用法?Java AsyncSupportConfigurer怎么用?Java AsyncSupportConfigurer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AsyncSupportConfigurer类属于org.springframework.web.servlet.config.annotation包,在下文中一共展示了AsyncSupportConfigurer类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: configureAsyncSupport

import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; //导入依赖的package包/类
@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());
		}
	});
}
 
开发者ID:allianzit,项目名称:ait-platform,代码行数:13,代码来源:AitWebMvcConfigurerAdapter.java

示例3: configureAsyncSupport

import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; //导入依赖的package包/类
@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;
            }
        });
}
 
开发者ID:rsdomingues,项目名称:wiredtigervsvmap,代码行数:13,代码来源:WebConfiguration.java

示例4: 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

示例5: configureAsyncSupport

import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; //导入依赖的package包/类
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
	Long timeout = this.mvcProperties.getAsync().getRequestTimeout();
	if (timeout != null) {
		configurer.setDefaultTimeout(timeout);
	}
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:WebMvcAutoConfiguration.java

示例6: 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

示例7: configureAsyncSupport

import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; //导入依赖的package包/类
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
	if (asyncRequestTimeout != null) {
		configurer.setDefaultTimeout(asyncRequestTimeout);
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:7,代码来源:StandaloneMockMvcBuilder.java

示例8: configureAsyncSupport

import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; //导入依赖的package包/类
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
	configurer.registerCallableInterceptors(callableInterceptor());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:AsyncControllerJavaConfigTests.java

示例9: 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

示例10: configureAsyncSupport

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

示例11: configureAsyncSupport

import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; //导入依赖的package包/类
@Override
public void configureAsyncSupport(final AsyncSupportConfigurer configurer) {
    configurer.setDefaultTimeout(nakadiStreamTimeout);
    configurer.registerCallableInterceptors(timeoutInterceptor());
}
 
开发者ID:zalando,项目名称:nakadi,代码行数:6,代码来源:WebConfig.java

示例12: 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

示例13: 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类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。