首页 > 其他分享 >ScheduledThreadPoolExecutor.setExecuteExistingDelayedTasksAfterShutdownPolicy(boolean value)

ScheduledThreadPoolExecutor.setExecuteExistingDelayedTasksAfterShutdownPolicy(boolean value)

时间:2023-07-02 13:07:49浏览次数:53  
标签:given tasks boolean ScheduledThreadPoolExecutor long task delay Runnable setExec


Method Summary

 void

execute(Runnable

          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

          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.



schedule(Callable<V> callable, long delay, TimeUnit

          Creates and executes a ScheduledFuture that becomes enabled after the given delay.

 ScheduledFuture<?>

schedule(Runnable command, long delay, TimeUnit

          Creates and executes a one-shot action that becomes enabled after the given delay.

 ScheduledFuture<?>

scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit

          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

          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.



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

          Submits a Runnable task for execution and returns a Future representing that task.



submit(Runnable

          Submits a Runnable task for execution and returns a Future representing that task that will upon completion return the given result

<V> ScheduledFuture<V>

标签:given,tasks,boolean,ScheduledThreadPoolExecutor,long,task,delay,Runnable,setExec
From: https://blog.51cto.com/u_16174476/6604413

相关文章

  • N层研习记录01:试图通过Boolean参数控制并发冲突的检查方式(LINQ to SQL)
    作者:光脚丫思考如果你只想快速的查看测试代码的主题部分,或者想更具体的了解测试的详细记录,则可以参看另一篇名为《N层研习中的测试代码01》的博文,地址是:微软MSDN带来的困惑微软的MSDN确实是个好东西,其中提供的技术资料,只要你善于去学习,必定是会受益匪浅的。毕竟,技术是微软的,它所......
  • N层研习记录01:试图通过Boolean参数控制并发冲突的检查方式(LINQ to SQL)
    作者:光脚丫思考版权所有,转载请注明出处!^_^此研习用到的测试代码可通过以下两个地址下载,如果不能下载,请留言通知我。下载地址02:http://u.115.com/file/f26716bcc2如果你只想快速的查看测试代码的主题部分,或者想更具体的了解测试的详细记录,则可以参看另一篇名为《N层研习中的测试代......
  • Predicate.test和直接用boolean有什么区别
    在Java中,Predicate接口和直接使用boolean类型的变量的主要区别在于它们的使用场景和灵活性。使用boolean类型的变量通常用于表示一个简单的逻辑条件,例如判断一个数是否为偶数。这种情况下,我们可以直接使用if语句或三元运算符来判断条件,并返回一个布尔值。而Predicate......
  • ScheduledThreadPoolExecutor模仿学习
     publicinterfaceCBlockingQueue<E>{booleanadd(Ee);Etake();} importjava.util.concurrent.Delayed;importjava.util.concurrent.FutureTask;importjava.util.concurrent.RunnableScheduledFuture;importjava.util.concurrent.TimeUnit;......
  • JavaBean中Boolean类型的字段名不要用isXxx(转)
    addbyzhj: 之前看阿里出品的Java开发手册中提到JavaBean中Boolean类型字段名不要用isXxx命名,一直不明白原因。这篇文章详细说明了原因。我对原文略微进行了修改,将fastjson库改为fastjson2,但对序列化反序列化结果没有影响。原文:https://mp.weixin.qq.com/s/b1q779XdWyRe0QyGxh......
  • 【已解决】可视化ValueError Cannot mask with non-boolean array containing NA NaN
    bug:raiseValueError(na_msg)ValueError:Cannotmaskwithnon-booleanarraycontainingNA/NaNvalues对应的代码:asian_countries=region_data.dropna(subset=['CountryCode'])[region_data['Region'].str.contains('Asia')][&......
  • BooleanBuilder 如何根据自定义列名 模糊查询 使用PathBuilder
     //动态传参//1.声明PathBuilder:MyTable为类名称,"myTable"为首字母小写后的类名PathBuilder<MyTable>path=newPathBuilder<>(MyTable.class,"myTable");//2.判断查询的列的名称是否不为空if(!ObjectUtils.isEmpty(xXXXCondition.getColumn1())){ Stri......
  • 【Java用法】Boolean.parseBoolean(string);
    String类型转boolean类型的一个方法当String的值为“true”时返回true,(此处true值是忽略大小写的)当为其他字符串时返回false。参考文档:Jdk1.8 中文版方法详细信息parseBooleanpublicstaticbooleanparseBoolean(Strings)将字符串参数解析为布尔值。boolean返回的代表值为true......
  • Codeforces 908H - New Year and Boolean Bridges(FWT)
    一道挺有意思的题,并且感觉有点诈骗的成分在内(首先考虑分析三种字符的性质:显然任意两点\(i,j\)之间要么\(i\)可以到达\(j\),要么\(j\)可以到达\(i\),否则AOX三个一个都不能满足。如果两点间的状态是A,那么这两点必须在同一强连通分量内。如果两点间的状态是X,那么这......
  • JTable的boolean列的全选/反选/全不选
    1、JTable的boolean列的全选/反选/全不选/** * *@Title:selectAll *@Description:TODO全选 *@paramtable *@paramcheckColumnIndex *@Author:wushigao *@CreateDate:2023年4月25日上午11:32:16 */ publicstaticvoidselectAll(JTabletable,i......