定时任务scheduleAtFixedRate设定每天某个时刻执行
使用下面這個(gè)定時(shí)任務(wù)方法實(shí)現(xiàn)
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
?
總結(jié)
以上是生活随笔為你收集整理的定时任务scheduleAtFixedRate设定每天某个时刻执行的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: springmvc提供RestContr
- 下一篇: was的启动与关闭