| 限定符和类型 | 字段和说明 |
|---|---|
protected long |
deadline |
protected TimerTask |
task |
protected HashedWheelTimer |
timer |
| 构造器和说明 |
|---|
HashedWheelTimeout(HashedWheelTimer timer,
TimerTask task,
long deadline) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
cancel()
Attempts to cancel the
TimerTask associated with this handle. |
boolean |
compareAndSetState(int expected,
int state) |
protected void |
executeTask() |
void |
expire() |
boolean |
isCancelled()
Returns
true if and only if the TimerTask associated
with this handle has been cancelled. |
boolean |
isExpired()
Returns
true if and only if the TimerTask associated
with this handle has been expired. |
void |
run() |
int |
state() |
TimerTask |
task()
Returns the
TimerTask which is associated with this handle. |
Timer |
timer()
Returns the
Timer that created this handle. |
String |
toString() |
protected final HashedWheelTimer timer
protected final TimerTask task
protected final long deadline
public HashedWheelTimeout(HashedWheelTimer timer, TimerTask task, long deadline)
public TimerTask task()
TimeoutTimerTask which is associated with this handle.public boolean cancel()
TimeoutTimerTask associated with this handle.
If the task has been executed or cancelled already, it will return with
no side effect.public boolean compareAndSetState(int expected,
int state)
public int state()
public boolean isCancelled()
Timeouttrue if and only if the TimerTask associated
with this handle has been cancelled.isCancelled 在接口中 Timeoutpublic boolean isExpired()
Timeouttrue if and only if the TimerTask associated
with this handle has been expired.public void expire()
protected void executeTask()
Copyright © 2021. All rights reserved.