|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.ethz.iks.util.Scheduler
public final class Scheduler
Scheduler utility. Objects can be scheduled and the registered listener is called when the scheduled object becomes due. Notice: this class is going to be removed once R-OSGi moves to CDC/Foundation 1.1 and the java.util.Timer class can be used instead.
Constructor Summary | |
---|---|
Scheduler(ScheduleListener listener)
create a new scheduler. |
Method Summary | |
---|---|
boolean |
isScheduled(java.lang.Object object)
check, if an object is already scheduled. |
void |
reschedule(java.lang.Object object,
long newTimestamp)
reschedule an object for a new timestamp. |
void |
schedule(java.lang.Object object,
long timestamp)
schedule an object. |
void |
start()
start the scheduler. |
void |
stop()
stop the scheduler. |
void |
unschedule(java.lang.Object object)
unschedule an object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Scheduler(ScheduleListener listener)
listener
- the listener that is called whenever a scheduled object has
become due.Method Detail |
---|
public void start()
public void stop()
public boolean isScheduled(java.lang.Object object)
object
- the object to check.
public void schedule(java.lang.Object object, long timestamp) throws java.lang.IllegalStateException
object
- the object.timestamp
- the timestamp.
java.lang.IllegalStateException
- if the object is already scheduled with a different
timestamp.public void reschedule(java.lang.Object object, long newTimestamp)
object
- the object.newTimestamp
- the new timestamp.public void unschedule(java.lang.Object object)
object
- the object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |