當前位置: 首頁>>代碼示例>>Java>>正文


Java ThreadPoolTaskExecutor.setCorePoolSize方法代碼示例

本文整理匯總了Java中org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor.setCorePoolSize方法的典型用法代碼示例。如果您正苦於以下問題:Java ThreadPoolTaskExecutor.setCorePoolSize方法的具體用法?Java ThreadPoolTaskExecutor.setCorePoolSize怎麽用?Java ThreadPoolTaskExecutor.setCorePoolSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor的用法示例。


在下文中一共展示了ThreadPoolTaskExecutor.setCorePoolSize方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getAsyncExecutor

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; //導入方法依賴的package包/類
@Override
@Bean
public Executor getAsyncExecutor() {
    log.debug("Creating Async Task Executor");
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(5);
    executor.setMaxPoolSize(50);

    executor.setWaitForTasksToCompleteOnShutdown(true);

    executor.setQueueCapacity(10000);
    executor.setThreadNamePrefix("cloudunit-Executor-");
    executor.initialize();
    return executor;
}
 
開發者ID:oncecloud,項目名稱:devops-cstack,代碼行數:16,代碼來源:AsyncConfiguration.java

示例2: getAsyncExecutor

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; //導入方法依賴的package包/類
@Override
@Bean(name = "taskExecutor")
public Executor getAsyncExecutor() {
    log.debug("Creating Async Task Executor");
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize());
    executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize());
    executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity());
    executor.setThreadNamePrefix("quali-toast-Executor-");
    return new ExceptionHandlingAsyncTaskExecutor(executor);
}
 
開發者ID:pascalgrimaud,項目名稱:qualitoast,代碼行數:12,代碼來源:AsyncConfiguration.java

示例3: getAsyncExecutor

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; //導入方法依賴的package包/類
@Bean(name = SKIPPER_EXECUTOR)
@Override
public Executor getAsyncExecutor() {
	ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
	threadPoolTaskExecutor.setCorePoolSize(5);
	threadPoolTaskExecutor.setMaxPoolSize(10);
	threadPoolTaskExecutor.setThreadNamePrefix("StateUpdate-");
	return threadPoolTaskExecutor;
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-skipper,代碼行數:10,代碼來源:SkipperServerConfiguration.java

示例4: getAsyncExecutor

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; //導入方法依賴的package包/類
@Override
@Bean
public Executor getAsyncExecutor() {
  final ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
  taskExecutor.setCorePoolSize(5);
  taskExecutor.setMaxPoolSize(100);
  taskExecutor.setThreadNamePrefix("Thread-");
  return taskExecutor;
}
 
開發者ID:stefanstaniAIM,項目名稱:IPPR2016,代碼行數:10,代碼來源:SpringAsyncConfig.java

示例5: getAsyncExecutor

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; //導入方法依賴的package包/類
@Override
@Bean(name = "taskExecutor")
public Executor getAsyncExecutor() {
    log.debug("Creating Async Task Executor");
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize());
    executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize());
    executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity());
    executor.setThreadNamePrefix("uaa-Executor-");
    return new ExceptionHandlingAsyncTaskExecutor(executor);
}
 
開發者ID:xm-online,項目名稱:xm-uaa,代碼行數:12,代碼來源:AsyncConfiguration.java

示例6: getAsyncExecutor

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; //導入方法依賴的package包/類
@Override
public Executor getAsyncExecutor() {
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(1);
    executor.setMaxPoolSize(1);
    executor.setQueueCapacity(1);
    executor.setThreadNamePrefix("Async-");
    executor.initialize();
    return executor;
}
 
開發者ID:dcos-utilities,項目名稱:f5-marathon-autoscale,代碼行數:11,代碼來源:AsyncConfiguration.java

示例7: getAsyncExecutor

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; //導入方法依賴的package包/類
@Override
public Executor getAsyncExecutor() {
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(5);
    executor.setThreadNamePrefix("AsyncExecutor-");
    executor.initialize();
    return executor;
}
 
開發者ID:ruslanys,項目名稱:vkmusic,代碼行數:9,代碼來源:ExecutorsConfig.java

示例8: getAsyncExecutor

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; //導入方法依賴的package包/類
@Override
@Bean(name = "taskExecutor")
public Executor getAsyncExecutor() {
    log.debug("Creating Async Task Executor");
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize());
    executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize());
    executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity());
    executor.setThreadNamePrefix("dashboard-Executor-");
    return new ExceptionHandlingAsyncTaskExecutor(executor);
}
 
開發者ID:xm-online,項目名稱:xm-ms-dashboard,代碼行數:12,代碼來源:AsyncConfiguration.java

示例9: configureAsyncSupport

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; //導入方法依賴的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

示例10: getAsyncExecutor

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; //導入方法依賴的package包/類
@Override
@Bean(name = "taskExecutor")
public Executor getAsyncExecutor() {
    log.debug("Creating Async Task Executor");
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize());
    executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize());
    executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity());
    executor.setThreadNamePrefix("task-executor-");
    return new ExceptionHandlingAsyncTaskExecutor(executor);
}
 
開發者ID:quanticc,項目名稱:sentry,代碼行數:12,代碼來源:AsyncConfiguration.java

示例11: backgroundConsumerExecutor

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; //導入方法依賴的package包/類
/**
 * This thread runs the WebSocketConsumerManager, which manages any consumers for web sockets.
 * It only needs a single thread, because the manager starts up its own managed thread pool.
 * @return new ThreadPool Task executor.
 */
@Bean
public TaskExecutor backgroundConsumerExecutor() {
    final ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    // Only a single thread in the pool
    executor.setCorePoolSize(1);
    executor.setMaxPoolSize(1);
    executor.setThreadNamePrefix("Web Socket Consumer Manager");
    executor.initialize();

    return executor;
}
 
開發者ID:SourceLabOrg,項目名稱:kafka-webview,代碼行數:17,代碼來源:WebSocketConfig.java

示例12: myThreadPool

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; //導入方法依賴的package包/類
@Bean
public ThreadPoolTaskExecutor myThreadPool() {
    ThreadPoolTaskExecutor te = new ThreadPoolTaskExecutor();

    te.setCorePoolSize(1);
    te.setMaxPoolSize(1);
    te.initialize();
    return te;
}
 
開發者ID:sejoung,項目名稱:ReactiveTest,代碼行數:10,代碼來源:SpringTobyTv010Application.java

示例13: kafkaMsgExecutor

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; //導入方法依賴的package包/類
@Bean
public TaskExecutor kafkaMsgExecutor() {
  ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
  int corePoolSize = StringUtils.isBlank(environment.getProperty(EXECUTOR_SET_CORE_POOL_SIZE)) ? 5 : Integer.parseInt(environment.getProperty(EXECUTOR_SET_CORE_POOL_SIZE));
  int maxPoolSize = StringUtils.isBlank(environment.getProperty(EXECUTOR_SET_MAX_POOL_SIZE)) ? 10 : Integer.parseInt(environment.getProperty(EXECUTOR_SET_MAX_POOL_SIZE));
  int queueCapacity = StringUtils.isBlank(environment.getProperty(EXECUTOR_SET_QUEUE_CAPACITY)) ? 25 : Integer.parseInt(environment.getProperty(EXECUTOR_SET_QUEUE_CAPACITY));
  executor.setCorePoolSize(corePoolSize);
  executor.setMaxPoolSize(maxPoolSize);
  executor.setQueueCapacity(queueCapacity);
  return executor;
}
 
開發者ID:chuangxian,項目名稱:lib-edge,代碼行數:12,代碼來源:TransferDefaultConfiguration.java

示例14: getAsyncExecutor

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; //導入方法依賴的package包/類
@Override
@Bean(name = "taskExecutor")
public Executor getAsyncExecutor() {
    log.debug("Creating Async Task Executor");
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize());
    executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize());
    executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity());
    executor.setThreadNamePrefix("store-Executor-");
    return new ExceptionHandlingAsyncTaskExecutor(executor);
}
 
開發者ID:IBM,項目名稱:Microservices-with-JHipster-and-Spring-Boot,代碼行數:12,代碼來源:AsyncConfiguration.java

示例15: getAsyncExecutor

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; //導入方法依賴的package包/類
@Override
@Bean(name = "taskExecutor")
public Executor getAsyncExecutor() {
    log.debug("Creating Async Task Executor");
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize());
    executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize());
    executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity());
    executor.setThreadNamePrefix("operoncloudplatform-Executor-");
    return new ExceptionHandlingAsyncTaskExecutor(executor);
}
 
開發者ID:AppertaFoundation,項目名稱:Code4Health-Platform,代碼行數:12,代碼來源:AsyncConfiguration.java


注:本文中的org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor.setCorePoolSize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。