Package net.sf.eBus.util
Class TimerTask
- java.lang.Object
-
- java.util.TimerTask
-
- net.sf.eBus.util.TimerTask
-
- All Implemented Interfaces:
Runnable
@Deprecated public final class TimerTask extends TimerTask
Deprecated.Will remove in future releases. Please seenet.sf.eBus.client.EScheduledExecutor.AneBus.util.TimerTaskassociates a timer task with aTimerTaskListener. When the timer expires,TimerTaskListener.handleTimeout(TimerEvent)whereEventObject.getSource()returns the value passed to theTimerTask(TimerTaskListener, Object)constructor.In eBus v. 4.2.0,
TimerTaskListeneris marked as a@FunctionalInterface. This allows the listener to be defined using a lambda expression.If
TimerTaskListener.handleTimeout(TimerEvent)throws an exception, the exception stack trace is logged at the warning level.- Author:
- Charles Rapp
-
-
Constructor Summary
Constructors Constructor Description TimerTask(TimerTaskListener listener)Deprecated.Creates a newTimerTask.TimerTask(TimerTaskListener listener, Object value)Deprecated.Creates a newTimerTask.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleancancel()Deprecated.Cancels this timer task.voidrun()Deprecated.Tells the listener that this timer has expired.Objectvalue()Deprecated.Returns optional value associated with this timer task.-
Methods inherited from class java.util.TimerTask
scheduledExecutionTime
-
-
-
-
Constructor Detail
-
TimerTask
public TimerTask(TimerTaskListener listener)
Deprecated.Creates a newTimerTask. This task is sent to theTimerTaskListenerwhen the timer expires. The associated value isnull.- Parameters:
listener- Inform this listener of the timeout.- Throws:
NullPointerException- iflistenerisnull.
-
TimerTask
public TimerTask(TimerTaskListener listener, Object value)
Deprecated.Creates a newTimerTask. This task is sent toTimerTaskListener.handleTimeout(TimerEvent)when the timer expires. The associated value isvalue.- Parameters:
listener- Inform this listener of the timeout.value- The associated value passed to the listener. May benull.- Throws:
NullPointerException- iflistenerisnull.
-
-
Method Detail
-
cancel
public boolean cancel()
Deprecated.Cancels this timer task. Seejava.util.TimerTask.cancelfor a detailed description of cancel.
-
run
public void run()
Deprecated.Tells the listener that this timer has expired.Note: Do not call this method! This method is part of
java.util.TimerTaskand should be called byjava.util.Timeronly.
-
value
@Nullable public Object value()
Deprecated.Returns optional value associated with this timer task. May returnnull.- Returns:
- optional timer task value.
-
-