|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hyperic.util.schedule.Schedule
public class Schedule
A generic scheduler object which keeps track of events, when they should be executed, deletion after invocation, etc. The basetime used when doing any arithmetic with times is the epoch. The scheduler is synchronized. Scheduled events have an interval property -- how often the event should execute (in milliseconds).
Constructor Summary | |
---|---|
Schedule()
|
Method Summary | |
---|---|
java.util.List |
consumeNextItems()
Get the next item (or items) to be executed. |
int |
getNumItems()
Get the number of items in the schedule. |
ScheduledItem[] |
getScheduledItems()
Get a list of all the currently scheduled items. |
long |
getTimeOfNext()
Get the time that the next scheduled item is to be executed. |
static void |
main(java.lang.String[] args)
|
long |
scheduleItem(java.lang.Object item,
long interval)
Add an item to the internal schedule, with the repeat flag set to true. |
long |
scheduleItem(java.lang.Object item,
long interval,
boolean repeat)
Add an item to the internal schedule. |
long |
scheduleItem(java.lang.Object item,
long interval,
boolean prev,
boolean repeat)
Add an item to the internal schedule. |
ScheduledItem |
unscheduleItem(long id)
Remove an item from the schedule. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Schedule()
Method Detail |
---|
public long scheduleItem(java.lang.Object item, long interval, boolean prev, boolean repeat) throws ScheduleException
item
- the object to scheduleinterval
- the number of seconds between invocations of the itemprev
- true if the item should be scheduled in the past to
force immediate firing.repeat
- true if the item should stay in the schedule even after
its time has expired
UnscheduledItemException
- If the given schedule interval is <= 0
ScheduleException
public long scheduleItem(java.lang.Object item, long interval, boolean repeat) throws ScheduleException
item
- the object to scheduleinterval
- the number of seconds between invocations of the itemrepeat
- true if the item should stay in the schedule even after
its time has expired
ScheduleException
public long scheduleItem(java.lang.Object item, long interval) throws ScheduleException
ScheduleException
public ScheduledItem unscheduleItem(long id) throws UnscheduledItemException
id
- ID returned by a call to scheduleItem of the item to remove
UnscheduledItemException
- indicating the ID was not found.public long getTimeOfNext() throws EmptyScheduleException
EmptyScheduleException
- indicating there is no next item for
which the time can be retrieved.public java.util.List consumeNextItems() throws EmptyScheduleException
EmptyScheduleException
- indicating there was no 'next item'public int getNumItems()
public ScheduledItem[] getScheduledItems()
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |