Top Description Methods
io.netty.util

public Interface Timer

Known Direct Implementers
io.netty.util.HashedWheelTimer
Imports
java.util.Set, java.util.concurrent.RejectedExecutionException, .TimeUnit

Schedules TimerTasks for one-time future execution in a background thread.

Method Summary

Modifier and TypeMethod and Description
public Timeout

Returns:

a handle which is associated with the specified task
newTimeout
(TimerTask task, long delay, TimeUnit unit)

Schedules the specified TimerTask for one-time execution after the specified delay.

public Set<Timeout>

Returns:

the handles associated with the tasks which were canceled by this method
stop
()

Releases all resources acquired by this Timer and cancels all tasks which were scheduled but not executed yet.

Method Detail

newTimeoutback to summary
public Timeout newTimeout(TimerTask task, long delay, TimeUnit unit)

Schedules the specified TimerTask for one-time execution after the specified delay.

Returns:Timeout

a handle which is associated with the specified task

Exceptions
IllegalStateException:
if this timer has been stopped already
RejectedExecutionException:
if the pending timeouts are too many and creating new timeout can cause instability in the system.
stopback to summary
public Set<Timeout> stop()

Releases all resources acquired by this Timer and cancels all tasks which were scheduled but not executed yet.

Returns:Set<Timeout>

the handles associated with the tasks which were canceled by this method