|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.openeai.OpenEaiObject
|
+--org.openeai.afa.Schedule
This is a class that wraps the execution details of a set of commands. It keeps track of when a particular command(s) should execute. The ScheduledApp class will use these objects to determine when commands associated to this Schedule should run. Then the ScheduledApp will execute the command(s) associated with this Schedule.
The Schedule object allows a flexible mechanism to associate certain times, days or intervals at which the ScheduledCommands associated to this schedule should run. By querying this information the ScheduledApp component can determine if the ScheduledCommands associated to this Schedule should run and if so, execute them.
| Field Summary |
| Fields inherited from class org.openeai.OpenEaiObject |
logger |
| Constructor Summary | |
Schedule(ScheduleConfig sConfig)
Constructs the Schedule object with a ScheduleConfig object which wraps the Schedules information found in the ScheduledApp's deployment document. |
|
| Method Summary | |
void |
addCommand(java.lang.String name,
CommandConfig cConfig)
Adds a command to this schedule. |
ScheduledCommand |
getCommand(java.lang.String name)
Returns a ScheduledCommand associated to this schedule by name. |
java.util.HashMap |
getCommands()
Returns all ScheduledCommands associated to this schedule. |
java.lang.String |
getName()
Returns the Schedule name according to information found in the config document for the application being configured. |
java.util.List |
getScheduleRuntimes()
Returns an ArrayList that contains ScheduleRuntime objects associated to this Schedule. |
boolean |
isImmediate()
Tells the caller if this Schedule is suppose to run immediately. |
void |
setCommands(java.util.HashMap commands)
Sets all ScheduledCommands associated to this schedule. |
void |
setName(java.lang.String name)
Sets the Schedule name according to information found in the config document for the application being configured. |
boolean |
shouldRun()
Determines if the ScheduledCommands associated to this Schedule should run. |
| Methods inherited from class org.openeai.OpenEaiObject |
addLog4jProperty, getAppName, getDebug, getFromAddr, getLog4jProperties, getMailHost, getMailService, getProperties, getToAddr, initializeLog4j, initializeLog4j, initializeLog4j, setAppName, setDebug, setFromAddr, setMailHost, setMailService, setProperties, setToAddr |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Schedule(ScheduleConfig sConfig)
| Method Detail |
public final void addCommand(java.lang.String name,
CommandConfig cConfig)
public final ScheduledCommand getCommand(java.lang.String name)
public final void setCommands(java.util.HashMap commands)
public final java.util.HashMap getCommands()
public final void setName(java.lang.String name)
public final java.lang.String getName()
public final java.util.List getScheduleRuntimes()
public final boolean shouldRun()
throws ScheduleIdStoreException
Factors that determine when a Schedule should be ran include the Schedule's 'runtime'. The Schedule object contains a list of 'runtimes' associated to this Schedule that tell it the Days and Times that this Schedule should be ran. When a Schedule has been executed, it will update its ScheduleIdStore indicating that the Schedule has been run. This store is checked to ensure a Schedule is not executed more than once in a given day. This store is persisted to a configurable location to survive the application stopping and starting. When the day changes (midnight is reached) the Schedule will remove any Schedule id's from the store for the new day so they will again be executed.
ScheduleIdStoreException - if errors occur determining if the Schedule should be ran.ScheduleRuntime,
ScheduleIdStorepublic final boolean isImmediate()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||