定时任务scheduleAtFixedRate设定每天某个时刻执行
使用下面这个定时任务方法实现
ScheduledFuture<?> java.util.concurrent.ScheduledExecutorService.scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
Parameters : command the task to executeinitialDelay the time to delay first executionperiod the period between successive executionsunit the time unit of the initialDelay and period parameters
Returns : a ScheduledFuture representing pending completion ofthe task, and whose get() method will throw anexception upon cancellation
Throws : RejectedExecutionException - if the task cannot bescheduled for executionNullPointerException - if command is nullIllegalArgumentException - if period less than or equal to zero
总结
以上是生活随笔为你收集整理的定时任务scheduleAtFixedRate设定每天某个时刻执行的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: springmvc提供RestContr
- 下一篇: was的启动与关闭