|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.mbari.siam.core.ScheduleTask
public abstract class ScheduleTask
The ScheduleTask is a standalone job that may be scheduled, encapsulating both the represention and execution of the job. The ScheduleTask has a - ScheduleEntry representing the schedule itself - SiamTimerTask that does timing - ScheduleTimerTask timer task that is associated (created and destroyed with) the timer task Subclasses should - implement the execute method, calling owner methods
| Field Summary | |
|---|---|
static int |
CHECK_TIME
readyAction: CHECK_TIME |
static int |
COUNTER_EXPIRED
Counter Expired |
static int |
EXECUTING
Executing |
static int |
READY
Ready |
static int |
RUN
readyAction: RUN |
static int |
SUSPENDED
Suspended |
static int |
WAITING
Waiting |
| Constructor Summary | |
|---|---|
ScheduleTask()
|
|
ScheduleTask(long interval,
java.lang.String name,
ScheduleOwner owner)
Constructor |
|
ScheduleTask(ScheduleSpecifier schedule,
java.lang.String name,
ScheduleOwner owner)
Constructor |
|
ScheduleTask(java.lang.String schedule,
java.lang.String name,
ScheduleOwner owner)
Constructor |
|
| Method Summary | |
|---|---|
void |
cancelTimer()
Cancel Timer associated with this entry |
boolean |
equals(ScheduleTask schedule)
Compare two ScheduleTasks |
abstract void |
execute()
Subclasses must implement. |
void |
fakeJob()
Execute fake Job associated with this entry |
java.lang.String |
get(int field)
Get field |
java.util.Calendar |
getEntryTime()
Get calendar representing current time in time zone indicate in this ScheduleTask |
java.util.Calendar |
getEntryTime(long time)
Get calendar representing time in time zone indicate in this ScheduleTask |
java.lang.Integer |
getKey()
|
long |
getLongCycles()
Get Long Cycles |
java.lang.String |
getName()
|
ScheduleOwner |
getOwner()
|
long |
getOwnerID()
Get owner ID |
java.lang.String |
getOwnerName()
|
long |
getPeriod()
Get (ScheduleSpecifier) period |
ScheduleSpecifier |
getScheduleSpecifier()
Get _scheduleSpecifier member |
int |
getState()
Get _state member |
java.lang.String |
getStateName(int state)
Get name of state |
SiamTimer |
getTimer()
getTimer |
SiamTimerTask |
getTimerTask()
Get TimerTask |
java.util.TimeZone |
getTZ()
Get TimeZone Object |
boolean |
isAbsolute()
Return true if schedule type is absolute |
boolean |
isMasked()
|
boolean |
isReady()
Returns true if time matches or exceeds a scheduled time |
boolean |
isReady(long time)
Returns true if time matches or exceeds a scheduled time |
boolean |
isRelative()
Return true if schedule type is relative |
boolean |
isSelectedTime(java.util.Calendar calendar)
Return true is calendar matches the schedule spec |
ScheduleTask |
parse(java.lang.String line)
parse a line from the schedule file. |
protected void |
rescheduleTimer(java.util.Date startTime)
Reschedule Timer |
protected void |
rescheduleTimer(long delay)
Reschedule Timer |
void |
resetAbsoluteTimer()
Reset (absolute) task according to next scheduled execution time. |
void |
resetTimer()
Restart a timer; this differs from sync in that it doesn't cause an absolute schedule to run immediately. |
int |
resume()
Resume ScheduleTask operation |
void |
setKey(int key)
|
void |
setKey(java.lang.Integer key)
|
void |
setLongCycles(long cycles)
Set Long Cycles |
void |
setName(java.lang.String name)
|
void |
setOwnerID(long id)
Set Long Cycles |
void |
setOwnerName(java.lang.String name)
|
void |
setSpecifier(ScheduleSpecifier spec)
Set _scheduleSpecifier member |
protected void |
setState(int state)
Set _state member |
void |
setTimer(SiamTimer timer)
setTimer |
void |
setTimerTask(SiamTimerTask task)
Set TimerTask |
long |
sleepingUntil()
If owner says that executing thread is for this task is sleeping, return time (msec since epoch) at which task will resume. |
int |
suspend()
Suspend ScheduleTask operation |
void |
sync()
"Sync"* this scheduler entry after the specified delay. |
int |
sync(long delayMillis)
|
long |
timeRemaining()
Calculate time remaining to next scheduled execution |
long |
timeRemaining(long lookAheadSeconds)
Calculate time remaining to next scheduled execution |
java.lang.String |
toString()
toString() convert schedule entry to string |
java.lang.String |
toString(long lookAheadSeconds)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int WAITING
public static final int EXECUTING
public static final int SUSPENDED
public static final int READY
public static final int COUNTER_EXPIRED
public static final int RUN
public static final int CHECK_TIME
| Constructor Detail |
|---|
public ScheduleTask()
public ScheduleTask(java.lang.String schedule,
java.lang.String name,
ScheduleOwner owner)
throws ScheduleParseException
schedule - cron-like schedulename - schedule nameowner - owner of this ScheduleTask
ScheduleParseException
public ScheduleTask(ScheduleSpecifier schedule,
java.lang.String name,
ScheduleOwner owner)
throws ScheduleParseException
schedule - ScheduleSpecifiername - schedule nameowner - owner of this ScheduleTask
ScheduleParseException
public ScheduleTask(long interval,
java.lang.String name,
ScheduleOwner owner)
throws ScheduleParseException
interval - sample intervalname - schedule nameowner - owner of this ScheduleTask
ScheduleParseException| Method Detail |
|---|
public ScheduleOwner getOwner()
public java.lang.String getStateName(int state)
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getOwnerName()
public void setOwnerName(java.lang.String name)
public java.lang.Integer getKey()
public void setKey(int key)
public void setKey(java.lang.Integer key)
public ScheduleSpecifier getScheduleSpecifier()
public void setSpecifier(ScheduleSpecifier spec)
public int getState()
protected void setState(int state)
public SiamTimer getTimer()
public void setTimer(SiamTimer timer)
public void setTimerTask(SiamTimerTask task)
public SiamTimerTask getTimerTask()
public long getPeriod()
public java.lang.String get(int field)
public java.util.TimeZone getTZ()
public long getLongCycles()
public void setLongCycles(long cycles)
public long getOwnerID()
public void setOwnerID(long id)
public boolean isAbsolute()
public boolean isRelative()
public boolean isSelectedTime(java.util.Calendar calendar)
public ScheduleTask parse(java.lang.String line)
throws ScheduleParseException
ScheduleParseExceptionpublic java.util.Calendar getEntryTime()
public java.util.Calendar getEntryTime(long time)
public boolean isReady()
public boolean isMasked()
public boolean isReady(long time)
public abstract void execute()
execute in interface Schedulablepublic void fakeJob()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(long lookAheadSeconds)
public long timeRemaining()
public long timeRemaining(long lookAheadSeconds)
public void sync()
public int sync(long delayMillis)
public void resetTimer()
public void resetAbsoluteTimer()
protected void rescheduleTimer(long delay)
protected void rescheduleTimer(java.util.Date startTime)
public void cancelTimer()
public int suspend()
public int resume()
public boolean equals(ScheduleTask schedule)
public long sleepingUntil()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||