public class TaskScheduler extends ScheduledThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
Constructor and Description |
---|
TaskScheduler(int poolSize)
Creates a new scheduler for loaders with the given thread pool size.
|
Modifier and Type | Method and Description |
---|---|
protected <V> RunnableScheduledFuture<V> |
decorateTask(Callable<V> callable,
RunnableScheduledFuture<V> task) |
protected <V> RunnableScheduledFuture<V> |
decorateTask(Runnable runnable,
RunnableScheduledFuture<V> task) |
void |
shutdown() |
List<Runnable> |
shutdownNow() |
execute, getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, getRemoveOnCancelPolicy, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, setRemoveOnCancelPolicy, 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
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated
public TaskScheduler(int poolSize)
poolSize
- The number of threads available in the pool of this scheduler.protected <V> RunnableScheduledFuture<V> decorateTask(Runnable runnable, RunnableScheduledFuture<V> task)
decorateTask
in class ScheduledThreadPoolExecutor
protected <V> RunnableScheduledFuture<V> decorateTask(Callable<V> callable, RunnableScheduledFuture<V> task)
decorateTask
in class ScheduledThreadPoolExecutor
public void shutdown()
shutdown
in interface ExecutorService
shutdown
in class ScheduledThreadPoolExecutor
public List<Runnable> shutdownNow()
shutdownNow
in interface ExecutorService
shutdownNow
in class ScheduledThreadPoolExecutor
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.