public abstract class AbstractRetryable extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRetryable()
初始化类的新实例.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
attempt()
尝试执行任务一次.
|
void |
execute(long interval,
long timeout)
在没有启动延迟的情况下执行任务.
|
public void execute(long interval,
long timeout)
throws Exception
interval - 每个任务执行尝试之间的间隔.timeout - 超时之后,我们将不再尝试再次执行任务.InstrumentException - 如果超时了.Exception - 对于所有其他错误条件.Copyright © 2019. All rights reserved.