Package io.netty.util
Class HashedWheelTimer.HashedWheelTimeout
- java.lang.Object
-
- io.netty.util.HashedWheelTimer.HashedWheelTimeout
-
- All Implemented Interfaces:
Timeout
- Enclosing class:
- HashedWheelTimer
private static final class HashedWheelTimer.HashedWheelTimeout extends java.lang.Object implements Timeout
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description HashedWheelTimeout(HashedWheelTimer timer, TimerTask task, long deadline)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
cancel()
Attempts to cancel theTimerTask
associated with this handle.boolean
compareAndSetState(int expected, int state)
void
expire()
boolean
isCancelled()
Returnstrue
if and only if theTimerTask
associated with this handle has been cancelled.boolean
isExpired()
Returnstrue
if and only if theTimerTask
associated with this handle has been expired.(package private) void
remove()
int
state()
TimerTask
task()
Returns theTimerTask
which is associated with this handle.Timer
timer()
Returns theTimer
that created this handle.java.lang.String
toString()
-
-
-
Field Detail
-
ST_INIT
private static final int ST_INIT
- See Also:
- Constant Field Values
-
ST_CANCELLED
private static final int ST_CANCELLED
- See Also:
- Constant Field Values
-
ST_EXPIRED
private static final int ST_EXPIRED
- See Also:
- Constant Field Values
-
STATE_UPDATER
private static final java.util.concurrent.atomic.AtomicIntegerFieldUpdater<HashedWheelTimer.HashedWheelTimeout> STATE_UPDATER
-
timer
private final HashedWheelTimer timer
-
task
private final TimerTask task
-
deadline
private final long deadline
-
state
private volatile int state
-
remainingRounds
long remainingRounds
-
next
HashedWheelTimer.HashedWheelTimeout next
-
prev
HashedWheelTimer.HashedWheelTimeout prev
-
bucket
HashedWheelTimer.HashedWheelBucket bucket
-
-
Constructor Detail
-
HashedWheelTimeout
HashedWheelTimeout(HashedWheelTimer timer, TimerTask task, long deadline)
-
-
Method Detail
-
timer
public Timer timer()
Description copied from interface:Timeout
Returns theTimer
that created this handle.
-
task
public TimerTask task()
Description copied from interface:Timeout
Returns theTimerTask
which is associated with this handle.
-
cancel
public boolean cancel()
Description copied from interface:Timeout
Attempts to cancel theTimerTask
associated with this handle. If the task has been executed or cancelled already, it will return with no side effect.
-
remove
void remove()
-
compareAndSetState
public boolean compareAndSetState(int expected, int state)
-
state
public int state()
-
isCancelled
public boolean isCancelled()
Description copied from interface:Timeout
Returnstrue
if and only if theTimerTask
associated with this handle has been cancelled.- Specified by:
isCancelled
in interfaceTimeout
-
isExpired
public boolean isExpired()
Description copied from interface:Timeout
Returnstrue
if and only if theTimerTask
associated with this handle has been expired.
-
expire
public void expire()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-