當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。