Interface TimerTask
public interface TimerTask
A task which is executed after the delay specified with
Timer.newTimeout(TimerTask, long, TimeUnit).-
Method Summary
Modifier and TypeMethodDescriptiondefault voidCalled forTimerTasks that are successfully canceled viaTimeout.cancel().voidExecuted after the delay specified withTimer.newTimeout(TimerTask, long, TimeUnit).
-
Method Details
-
run
Executed after the delay specified withTimer.newTimeout(TimerTask, long, TimeUnit).- Parameters:
timeout- a handle which is associated with this task- Throws:
Exception
-
cancelled
Called forTimerTasks that are successfully canceled viaTimeout.cancel(). Overriding this method allows to for example run some cleanup.- Parameters:
timeout- a handle which is associated with this task
-