org.mule.util.timer
Class EventTimerTask

java.lang.Object
  extended by java.util.TimerTask
      extended by org.mule.util.timer.EventTimerTask
All Implemented Interfaces:
Runnable

public class EventTimerTask
extends TimerTask

EventTimerTask is a task that causes TimeEvent to be fired to listening objects when a specific number of milliseconds have passed. This implementation is based on the java.util.TimerTask.


Constructor Summary
EventTimerTask(TimeEventListener listener)
          Constructs a EventTimeTask and registers a listener with it
EventTimerTask(TimeEventListener listener, String name)
          Constructs a EventTimeTask and registers a listener with it
 
Method Summary
 void addListener(TimeEventListener listener)
           
protected  void fireTimerEvent(TimeEvent event)
           
 String getName()
          Gets the task name (this is also the timer thread name)
 boolean isStarted()
           
 void removeAllListeners()
           
 void removeListener(TimeEventListener listener)
           
 void run()
          The action to be performed by this timer task.
 void start()
           
 void stop()
           
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventTimerTask

public EventTimerTask(TimeEventListener listener)
Constructs a EventTimeTask and registers a listener with it

Parameters:
listener - the listener to register

EventTimerTask

public EventTimerTask(TimeEventListener listener,
                      String name)
Constructs a EventTimeTask and registers a listener with it

Parameters:
listener - the listener to register
name - the name for the task
Method Detail

run

public void run()
The action to be performed by this timer task. The fireTime event method is called.

Specified by:
run in interface Runnable
Specified by:
run in class TimerTask

getName

public String getName()
Gets the task name (this is also the timer thread name)

Returns:
the task name

removeListener

public void removeListener(TimeEventListener listener)

removeAllListeners

public void removeAllListeners()

addListener

public void addListener(TimeEventListener listener)

fireTimerEvent

protected void fireTimerEvent(TimeEvent event)

stop

public void stop()

start

public void start()

isStarted

public boolean isStarted()


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.