Package io.netty.util
Class HashedWheelTimer.HashedWheelTimeout
- java.lang.Object
-
- io.netty.util.HashedWheelTimer.HashedWheelTimeout
-
- All Implemented Interfaces:
Timeout,java.lang.Runnable
- Enclosing class:
- HashedWheelTimer
private static final class HashedWheelTimer.HashedWheelTimeout extends java.lang.Object implements Timeout, java.lang.Runnable
-
-
Field Summary
Fields Modifier and Type Field Description (package private) HashedWheelTimer.HashedWheelBucketbucketprivate longdeadline(package private) HashedWheelTimer.HashedWheelTimeoutnext(package private) HashedWheelTimer.HashedWheelTimeoutprev(package private) longremainingRoundsprivate static intST_CANCELLEDprivate static intST_EXPIREDprivate static intST_INITprivate intstateprivate static java.util.concurrent.atomic.AtomicIntegerFieldUpdater<HashedWheelTimer.HashedWheelTimeout>STATE_UPDATERprivate TimerTasktaskprivate HashedWheelTimertimer
-
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 booleancancel()Attempts to cancel theTimerTaskassociated with this handle.booleancompareAndSetState(int expected, int state)voidexpire()booleanisCancelled()Returnstrueif and only if theTimerTaskassociated with this handle has been cancelled.booleanisExpired()Returnstrueif and only if theTimerTaskassociated with this handle has been expired.(package private) voidremove()voidrun()intstate()TimerTasktask()Returns theTimerTaskwhich is associated with this handle.Timertimer()Returns theTimerthat created this handle.java.lang.StringtoString()
-
-
-
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:TimeoutReturns theTimerthat created this handle.
-
task
public TimerTask task()
Description copied from interface:TimeoutReturns theTimerTaskwhich is associated with this handle.
-
cancel
public boolean cancel()
Description copied from interface:TimeoutAttempts to cancel theTimerTaskassociated 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:TimeoutReturnstrueif and only if theTimerTaskassociated with this handle has been cancelled.- Specified by:
isCancelledin interfaceTimeout
-
isExpired
public boolean isExpired()
Description copied from interface:TimeoutReturnstrueif and only if theTimerTaskassociated with this handle has been expired.
-
expire
public void expire()
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-