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_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 |
---|---|
boolean |
cancel()
Attempts to cancel the
TimerTask associated with this handle. |
boolean |
compareAndSetState(int expected,
int state) |
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. |
(package private) void |
remove() |
int |
state() |
TimerTask |
task()
Returns the
TimerTask which is associated with this handle. |
Timer |
timer()
Returns the
Timer that created this handle. |
java.lang.String |
toString() |
private static final int ST_INIT
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 timer()
Timeout
Timer
that created this handle.public TimerTask task()
Timeout
TimerTask
which is associated with this handle.public boolean cancel()
Timeout
TimerTask
associated with this handle.
If the task has been executed or cancelled already, it will return with
no side effect.void remove()
public boolean compareAndSetState(int expected, int state)
public int state()
public boolean isCancelled()
Timeout
true
if and only if the TimerTask
associated
with this handle has been cancelled.isCancelled
in interface Timeout
public boolean isExpired()
Timeout
true
if and only if the TimerTask
associated
with this handle has been expired.public void expire()
public java.lang.String toString()
toString
in class java.lang.Object