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


Java ThreadPoolTaskScheduler.setRemoveOnCancelPolicy方法代码示例

本文整理汇总了Java中org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler.setRemoveOnCancelPolicy方法的典型用法代码示例。如果您正苦于以下问题:Java ThreadPoolTaskScheduler.setRemoveOnCancelPolicy方法的具体用法?Java ThreadPoolTaskScheduler.setRemoveOnCancelPolicy怎么用?Java ThreadPoolTaskScheduler.setRemoveOnCancelPolicy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler的用法示例。


在下文中一共展示了ThreadPoolTaskScheduler.setRemoveOnCancelPolicy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: taskScheduler

import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; //导入方法依赖的package包/类
@Bean()
public ThreadPoolTaskScheduler taskScheduler() {
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
scheduler.setPoolSize(100);
scheduler.setThreadNamePrefix("Scheduler-");
scheduler.setWaitForTasksToCompleteOnShutdown(true);
scheduler.setRemoveOnCancelPolicy(true);
   return scheduler;
}
 
开发者ID:PacktPublishing,项目名称:Spring-5.0-Cookbook,代码行数:10,代码来源:SpringScheduledConfig.java

示例2: messageBrokerTaskScheduler

import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; //导入方法依赖的package包/类
@Bean(name={"messageBrokerTaskScheduler", "messageBrokerSockJsTaskScheduler"})
public ThreadPoolTaskScheduler messageBrokerTaskScheduler() {
	ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
	scheduler.setThreadNamePrefix("MessageBroker-");
	scheduler.setPoolSize(Runtime.getRuntime().availableProcessors());
	scheduler.setRemoveOnCancelPolicy(true);
	return scheduler;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:9,代码来源:AbstractMessageBrokerConfiguration.java

示例3: registrationTaskScheduler

import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; //导入方法依赖的package包/类
@Bean
@Qualifier("registrationTaskScheduler")
public TaskScheduler registrationTaskScheduler() {
    ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
    taskScheduler.setPoolSize(1);
    taskScheduler.setRemoveOnCancelPolicy(true);
    taskScheduler.setThreadNamePrefix("registrationTask");
    return taskScheduler;
}
 
开发者ID:codecentric,项目名称:spring-boot-admin,代码行数:10,代码来源:SpringBootAdminClientAutoConfiguration.java

示例4: defaultSockJsTaskScheduler

import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; //导入方法依赖的package包/类
/**
 * The default TaskScheduler to use if none is configured via
 * {@link SockJsServiceRegistration#setTaskScheduler}, i.e.
 * <pre class="code">
 * &#064;Configuration
 * &#064;EnableWebSocket
 * public class WebSocketConfig implements WebSocketConfigurer {
 *
 *   public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
 *     registry.addHandler(myWsHandler(), "/echo").withSockJS().setTaskScheduler(myScheduler());
 *   }
 *
 *   // ...
 * }
 * </pre>
 */
@Bean
public ThreadPoolTaskScheduler defaultSockJsTaskScheduler() {
	ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
	scheduler.setThreadNamePrefix("SockJS-");
	scheduler.setPoolSize(Runtime.getRuntime().availableProcessors());
	scheduler.setRemoveOnCancelPolicy(true);
	return scheduler;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:25,代码来源:WebSocketConfigurationSupport.java

示例5: messageBrokerSockJsTaskScheduler

import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; //导入方法依赖的package包/类
/**
 * The default TaskScheduler to use if none is configured via
 * {@link SockJsServiceRegistration#setTaskScheduler(org.springframework.scheduling.TaskScheduler)}
 * , i.e.
 *
 * <pre class="code">
 * &#064;Configuration
 * public class WampConfig extends DefaultWampConfiguration {
 *
 * 	public void registerWampEndpoints(WampEndpointRegistry registry) {
 * 		registry.addEndpoint(&quot;/wamp&quot;).withSockJS().setTaskScheduler(myScheduler());
 * 	}
 *
 * 	// ...
 * }
 * </pre>
 */
@Bean
public ThreadPoolTaskScheduler messageBrokerSockJsTaskScheduler() {
	ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
	scheduler.setThreadNamePrefix("WampSockJS-");
	scheduler.setPoolSize(Runtime.getRuntime().availableProcessors());
	scheduler.setRemoveOnCancelPolicy(true);
	return scheduler;
}
 
开发者ID:ralscha,项目名称:wampspring,代码行数:26,代码来源:DefaultWampConfiguration.java


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