|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.scalagent.scheduler.Scheduler
public class Scheduler
Nested Class Summary | |
---|---|
class |
Scheduler.WakeUp
|
Field Summary | |
---|---|
private ScheduleItem |
items
events list |
static org.objectweb.util.monolog.api.Logger |
logger
|
private static long |
serialVersionUID
define serialVersionUID for interoperability |
private java.util.Timer |
timer
the timer |
private Scheduler.WakeUp |
wakeUp
Current task schedule in Timer |
Constructor Summary | |
---|---|
Scheduler(java.util.Timer timer)
Creates the default scheduler. |
Method Summary | |
---|---|
private void |
cancel()
cancel a wake up task in timer. |
private void |
checkItems()
Checks for ripe events. |
private void |
insertItem(ScheduleEvent event,
ScheduleTask task)
insertItem ScheduleEvent event. |
private void |
insertItem(ScheduleItem newItem)
Inserts an item in the list ordered by date. |
private void |
readObject(java.io.ObjectInputStream in)
|
private void |
removeItem(ScheduleItem item)
Removes an item from the list. |
void |
restart(java.util.Timer timer)
restart scheduler. |
private void |
schedule(ScheduleEvent event,
long period)
schedule wake up task in timer. |
void |
scheduleEvent(ScheduleEvent event,
ScheduleTask task)
schedule an event. |
java.lang.String |
toString()
Provides a string image for this object. |
private void |
writeObject(java.io.ObjectOutputStream out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
public static org.objectweb.util.monolog.api.Logger logger
private transient ScheduleItem items
private transient java.util.Timer timer
private transient Scheduler.WakeUp wakeUp
Constructor Detail |
---|
public Scheduler(java.util.Timer timer) throws java.io.IOException
timer
- a ScalAgent timer.
java.io.IOException
Method Detail |
---|
public void restart(java.util.Timer timer) throws java.lang.Exception
timer
- a ScalAgent timer.
java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object
public void scheduleEvent(ScheduleEvent event, ScheduleTask task) throws java.lang.Exception
insertItem
.
Calls checkItems
.
event
- event to schedule.task
- task to execute.
java.lang.Exception
private void insertItem(ScheduleEvent event, ScheduleTask task)
ScheduleEvent
event.
event
- task
- task to execute.private void insertItem(ScheduleItem newItem)
newItem
- item to insertprivate void checkItems() throws java.lang.Exception
java.lang.Exception
private void removeItem(ScheduleItem item)
item
- item to removeprivate void schedule(ScheduleEvent event, long period)
event
- schedule event.period
- period in ms.private void cancel()
event
- schedule event.private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |