public class DynamicSizedSchedulerImpl extends java.util.concurrent.ScheduledThreadPoolExecutor implements DynamicSizedSchedulerInterface
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy
Constructor and Description |
---|
DynamicSizedSchedulerImpl(int corePoolSize,
java.lang.String poolName,
int maximumPoolSize)
Initialize a scheduler with dynamic pool size.
|
Modifier and Type | Method and Description |
---|---|
void |
setPoolSize(int newSize)
Update the pool thread count with this new value.
|
decorateTask, decorateTask, execute, getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, getRemoveOnCancelPolicy, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, setRemoveOnCancelPolicy, shutdown, shutdownNow, submit, submit, submit
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, terminated, toString
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay
public DynamicSizedSchedulerImpl(int corePoolSize, java.lang.String poolName, int maximumPoolSize)
corePoolSize
- initial Core pool sizepoolName
- name of pool to identify threadsmaximumPoolSize
- maximum pool sizepublic void setPoolSize(int newSize)
DynamicSizedSchedulerInterface
setPoolSize
in interface DynamicSizedSchedulerInterface
newSize
- New pool size that is superior to 0