ScheduledThreadPoolExecutor.setExecuteExistingDelayedTasksAfterShutdownPolicy(boolean value)

原创 2012年03月22日 20:13:03
Method Summary
 void execute(Runnable command)
          Execute command with zero required delay.
 boolean getContinueExistingPeriodicTasksAfterShutdownPolicy()
          Get the policy on whether to continue executing existing periodic tasks even when this executor has been shutdown.
 boolean getExecuteExistingDelayedTasksAfterShutdownPolicy()
          Get policy on whether to execute existing delayed tasks even when this executor has been shutdown.
 BlockingQueue<Runnable> getQueue()
          Returns the task queue used by this executor.
 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.
<V> ScheduledFuture<V>
schedule(Callable<V> callable, long delay, TimeUnit unit)
          Creates and executes a ScheduledFuture that becomes enabled after the given delay.
 ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
          Creates and executes a one-shot action that becomes enabled after the given delay.
 ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
          Creates and executes 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)
          Creates and executes 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)
          Set policy on whether to continue executing existing periodic tasks even when this executor has been shutdown.
 void setExecuteExistingDelayedTasksAfterShutdownPolicy(boolean value)
          Set policy on whether to execute existing delayed tasks even when this executor has been shutdown.
 void shutdown()
          Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.
 List<Runnable> shutdownNow()
          Attempts to stop all actively executing tasks, halts the processing of waiting tasks, and returns a list of the tasks that were awaiting execution.
<T> Future<T>
submit(Callable<T> task)
          Submits a value-returning task for execution and returns a Future representing the pending results of the task.
 Future<?> submit(Runnable task)
          Submits a Runnable task for execution and returns a Future representing that task.
<T> Future<T>
submit(Runnable task, T result)
          Submits a Runnable task for execution and returns a Future representing that task that will upon completion return the given result
版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

handbook of Boolean Algebras V.1

  • 2010-04-01 02:22
  • 2.49MB
  • 下载

Java 并发 使用 ScheduledThreadPoolExecutor进行温室参数变化仿真

package com.xyw.concurrent.blog; import java.util.concurrent.*; import java.util.*; /* * 通过模拟温室之中...

Java 一个优于Timer的定时器——ScheduledThreadPoolExecutor

TimeUnit 时间单元        换算进制: 1 2 3 4 5 6 7 static final long C0 = 1L; // 1微毫秒 ...

【Java并发】- ScheduledThreadPoolExecutor, ScheduledExecutorService使用

概述     ScheduledExecutorService的接口集成关系: Executor |---ExecutorService |--ScheduledExecutorService

Java ScheduledThreadPoolExecutor延迟或周期性执行任务

Java提供的Time类可以周期性地或者延期执行任务,但是有时我们需要并行执行同样的任务,这个时候如果创建多个Time对象会给系统带来负担,解决办法是将定时任务放到线程池中执行。 Java的Sche...

Timer与ScheduledThreadPoolExecutor

在实际应用中,有时候我们需要创建一些个延迟的、并具有周期性的任务,比如,我们希望当我们的程序启动后每隔1小时就去做一次日志记录。在JDK中提供了两种方法去创建延迟周期性任务。 Timer Timer是...

Timer和ScheduledThreadPoolExecutor的区别

Timer和ScheduledThreadPoolExecutor的区别            Timer的主要方法有:// 安排在指定的时间执行void schedule(TimerTas...

Java多线程 -- JUC包源码分析14 -- ScheduledThreadPoolExecutor与DelayQueue源码分析

DelayQueue ScheduledThreadPoolExecutor

java多线程组件三:ScheduledThreadPoolExecutor

在实际的情况中可能会需要有的线程是定期执行的,有的线程是只执行一次,如果通过Timer去触发,会涉及线程的切换以及线程安全问题,这对这种情况从jdk1.5开始添加了ScheduledThreadPoo...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)