Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| 构造器和说明 |
|---|
DelayCycleExecuteUtil(DelayCycleExecute dce) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
run() |
void |
setSleepArray(int[] sleepArray)
设置每次执行的延迟时间,单位:毫秒。
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic DelayCycleExecuteUtil(DelayCycleExecute dce)
public void setSleepArray(int[] sleepArray)
如果执行 DelayCycleExecute.executeProcedures(int) 失败,则延迟指定时间后,继续执行。直到成功为止,才退出循环
如设定数组为:new int[]{0,2000,6000,20000}
则第一次执行时,立即执行,不延迟;
若失败,则延迟2秒后再次执行;
若还失败,则延迟6秒后再次执行;
(若成功,退出循环,不再向下执行。同时运行 DelayCycleExecute.success() 方法)
若还失败,则延迟20秒后再次执行;
若还失败,此此时数组已到末尾,结束线程。同时会运行 DelayCycleExecute.failure() 方法
若不设置,默认为:
new int[]{0,3000,10000,60000,600000,6000000}
sleepArray - 设定的延迟数组。Copyright © 2019. All rights reserved.