List of usage examples for java.util.concurrent ScheduledThreadPoolExecutor setCorePoolSize
public void setCorePoolSize(int corePoolSize)
From source file:org.mule.config.pool.DefaultThreadPoolFactory.java
protected ScheduledThreadPoolExecutor internalCreateScheduledPool(ThreadingProfile tp) { ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor( Math.min(tp.getMaxThreadsIdle(), tp.getMaxThreadsActive())); scheduledThreadPoolExecutor.setContinueExistingPeriodicTasksAfterShutdownPolicy(false); scheduledThreadPoolExecutor.setExecuteExistingDelayedTasksAfterShutdownPolicy(true); scheduledThreadPoolExecutor.setKeepAliveTime(tp.getThreadTTL(), TimeUnit.MILLISECONDS); scheduledThreadPoolExecutor.setCorePoolSize(tp.getMaxThreadsIdle()); scheduledThreadPoolExecutor.setMaximumPoolSize(tp.getMaxThreadsActive()); return scheduledThreadPoolExecutor; }