private static final class HashedWheelTimer.HashedWheelTimeout extends java.lang.Object implements Timeout
| Modifier and Type | Field and Description |
|---|---|
(package private) HashedWheelTimer.HashedWheelBucket |
bucket |
private long |
deadline |
(package private) HashedWheelTimer.HashedWheelTimeout |
next |
(package private) HashedWheelTimer.HashedWheelTimeout |
prev |
(package private) long |
remainingRounds |
private static int |
ST_CANCELLED |
private static int |
ST_EXPIRED |
private static int |
ST_IN_BUCKET |
private static int |
ST_INIT |
private int |
state |
private static java.util.concurrent.atomic.AtomicIntegerFieldUpdater<HashedWheelTimer.HashedWheelTimeout> |
STATE_UPDATER |
private TimerTask |
task |
private HashedWheelTimer |
timer |
| Constructor and Description |
|---|
HashedWheelTimeout(HashedWheelTimer timer,
TimerTask task,
long deadline) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels the
TimerTask associated with this handle. |
boolean |
compareAndSetState(int expected,
int state) |
void |
expire() |
TimerTask |
getTask()
Returns the
TimerTask which is associated with this handle. |
Timer |
getTimer()
Returns the
Timer that created this handle. |
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 |
remove() |
int |
state() |
java.lang.String |
toString() |
HashedWheelTimer.HashedWheelTimeout |
value() |
private static final int ST_INIT
private static final int ST_IN_BUCKET
private static final int ST_CANCELLED
private static final int ST_EXPIRED
private static final java.util.concurrent.atomic.AtomicIntegerFieldUpdater<HashedWheelTimer.HashedWheelTimeout> STATE_UPDATER
private final HashedWheelTimer timer
private final TimerTask task
private final long deadline
private volatile int state
long remainingRounds
HashedWheelTimer.HashedWheelTimeout next
HashedWheelTimer.HashedWheelTimeout prev
HashedWheelTimer.HashedWheelBucket bucket
HashedWheelTimeout(HashedWheelTimer timer, TimerTask task, long deadline)
public Timer getTimer()
TimeoutTimer that created this handle.public TimerTask getTask()
TimeoutTimerTask which is associated with this handle.public void cancel()
TimeoutTimerTask associated with this handle. It the
task has been executed or cancelled already, it will return with no
side effect.public void remove()
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 in interface Timeoutpublic boolean isExpired()
Timeouttrue if and only if the TimerTask associated
with this handle has been expired.public HashedWheelTimer.HashedWheelTimeout value()
public void expire()
public java.lang.String toString()
toString in class java.lang.Object