Knopflerfish OSGi 5.2.0

Class RepeatingJob

  extended by org.knopflerfish.util.workerthread.Job
      extended by org.knopflerfish.util.workerthread.RepeatingJob
All Implemented Interfaces:

public abstract class RepeatingJob
extends Job

Constructor Summary
RepeatingJob(int[] delays, int repeatPolicy)
          Creates a repetetive event.
Method Summary
 int getRepeatNo()
          Returns the number of successful repeats this job has made.
 void quit()
          This method can be called to stop repeating this Job.
Methods inherited from class org.knopflerfish.util.workerthread.Job
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public RepeatingJob(int[] delays,
                    int repeatPolicy)
Creates a repetetive event. This Job still needs to be added to an WorkerThread, but after its run has been called the first time, it will add itself after a delay indicated by delays[0]. Subsequent runs will occur as indicated by the array delays. All delays are in milliseconds.

delays - The delays (in milliseconds) to make between the calls to this RepeatingJobs run() method.
repeatPolicy - Indicates what to do when this RepeatingJob has been called as many times as the delays parameter specifies by its length. A positive value will keep on calling the run() method indefinitely, each time using repeatPolicy milliseconds as the delay. A negative value or zero, will cause this event not to be repeated any more.
Method Detail


public void quit()
This method can be called to stop repeating this Job.


public int getRepeatNo()
Returns the number of successful repeats this job has made. I.e., the number of times its run() method has been invoked and terminated normally since it was last added to the WorkerThread.

Knopflerfish OSGi 5.2.0