Save This Page
Home » jboss-5.0.0.CR1-src » org.jboss.mx » util » [javadoc | source]
org.jboss.mx.util
abstract public class: SchedulableRunnable [javadoc | source]
java.lang.Object
   org.jboss.mx.util.SchedulableRunnable

All Implemented Interfaces:
    Runnable

Direct Known Subclasses:
    RegisteredNotification, MonitorRunnable

A schedulable runnable.

Subclasses should implement doRun() to do some real work.

setScheduler(RunnableScheduler) has to be invoked with a RunnableScheduler that has been started for the work to be performed. If the doRun() does not invoke setNextRun(), the link to the scheduler is removed.

Constructor:
 public SchedulableRunnable() 
Method from org.jboss.mx.util.SchedulableRunnable Summary:
doRun,   getNextRun,   run,   setNextRun,   setScheduler
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jboss.mx.util.SchedulableRunnable Detail:
 abstract public  void doRun()
    Do the work, the scheduled runnable should do its work here
 public long getNextRun() 
    Gets the next run timestamp
 public final  void run() 
    Runs doRun()

    If setNextRun() is not invoked during the doRun(), the link to the scheduler is removed

 public synchronized  void setNextRun(long nextRun) 
    Sets the next run date

    If it is linked to a scheduler, it is temporarily removed while the date is modified.

 public synchronized RunnableScheduler setScheduler(RunnableScheduler scheduler) 
    Set the scheduler for this runnable