Example usage for Java java.util.concurrent ScheduledThreadPoolExecutor fields, constructors, methods, implement or subclass
The text is from its open source code.
ScheduledThreadPoolExecutor(int corePoolSize) Creates a new ScheduledThreadPoolExecutor with the given core pool size. | |
ScheduledThreadPoolExecutor(int corePoolSize, ThreadFactory threadFactory) Creates a new ScheduledThreadPoolExecutor with the given initial parameters. | |
ScheduledThreadPoolExecutor(int corePoolSize, RejectedExecutionHandler handler) Creates a new ScheduledThreadPoolExecutor with the given initial parameters. | |
ScheduledThreadPoolExecutor(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler) Creates a new ScheduledThreadPoolExecutor with the given initial parameters. |
void | allowCoreThreadTimeOut(boolean value) Sets the policy governing whether core threads may time out and terminate if no tasks arrive within the keep-alive time, being replaced if needed when new tasks arrive. |
boolean | awaitTermination(long timeout, TimeUnit unit) |
Class> | getClass() Returns the runtime class of this Object . |
long | getCompletedTaskCount() Returns the approximate total number of tasks that have completed execution. |
boolean | getContinueExistingPeriodicTasksAfterShutdownPolicy() Gets the policy on whether to continue executing existing periodic tasks even when this executor has been shutdown . |
boolean | getExecuteExistingDelayedTasksAfterShutdownPolicy() Gets the policy on whether to execute existing delayed tasks even when this executor has been shutdown . |
long | getKeepAliveTime(TimeUnit unit) Returns the thread keep-alive time, which is the amount of time that threads may remain idle before being terminated. |
int | getPoolSize() Returns the current number of threads in the pool. |
BlockingQueue | getQueue() Returns the task queue used by this executor. |
boolean | getRemoveOnCancelPolicy() Gets the policy on whether cancelled tasks should be immediately removed from the work queue at time of cancellation. |
ThreadFactory | getThreadFactory() Returns the thread factory used to create new threads. |
boolean | remove(Runnable task) Removes this task from the executor's internal queue if it is present, thus causing it not to be run if it has not already started. |
ScheduledFuture> | schedule(Runnable command, long delay, TimeUnit unit) |
ScheduledFuture | schedule(Callable |
ScheduledFuture> | scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) Submits a periodic action that becomes enabled first after the given initial delay, and subsequently with the given period; that is, executions will commence after initialDelay , then initialDelay + period , then initialDelay + 2 * period , and so on. |
ScheduledFuture> | scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) Submits a periodic action that becomes enabled first after the given initial delay, and subsequently with the given delay between the termination of one execution and the commencement of the next. |
void | setContinueExistingPeriodicTasksAfterShutdownPolicy(boolean value) Sets the policy on whether to continue executing existing periodic tasks even when this executor has been shutdown . |
void | setCorePoolSize(int corePoolSize) Sets the core number of threads. |
void | setExecuteExistingDelayedTasksAfterShutdownPolicy(boolean value) Sets the policy on whether to execute existing delayed tasks even when this executor has been shutdown . |
void | setKeepAliveTime(long time, TimeUnit unit) Sets the thread keep-alive time, which is the amount of time that threads may remain idle before being terminated. |
void | setMaximumPoolSize(int maximumPoolSize) Sets the maximum allowed number of threads. |
void | setRejectedExecutionHandler(RejectedExecutionHandler handler) Sets a new handler for unexecutable tasks. |
void | shutdown() Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted. |
Future> | submit(Runnable task) |
Future | submit(Callable |