Package org.jboss.netty.util
Class HashedWheelTimer.HashedWheelTimeout
- java.lang.Object
-
- org.jboss.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_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 Summary
Constructors Constructor Description HashedWheelTimeout(HashedWheelTimer timer, TimerTask task, long deadline)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
Cancels theTimerTask
associated with this handle.boolean
compareAndSetState(int expected, int state)
void
expire()
TimerTask
getTask()
Returns theTimerTask
which is associated with this handle.Timer
getTimer()
Returns theTimer
that created this handle.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.void
remove()
int
state()
java.lang.String
toString()
HashedWheelTimer.HashedWheelTimeout
value()
-
-
-
Field Detail
-
ST_INIT
private static final int ST_INIT
- See Also:
- Constant Field Values
-
ST_IN_BUCKET
private static final int ST_IN_BUCKET
- 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
-
getTimer
public Timer getTimer()
Description copied from interface:Timeout
Returns theTimer
that created this handle.
-
getTask
public TimerTask getTask()
Description copied from interface:Timeout
Returns theTimerTask
which is associated with this handle.
-
cancel
public void cancel()
Description copied from interface:Timeout
Cancels theTimerTask
associated with this handle. It the task has been executed or cancelled already, it will return with no side effect.
-
remove
public 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.
-
value
public HashedWheelTimer.HashedWheelTimeout value()
-
expire
public void expire()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-