clock | The clock to use. |
current | This is the current/next result from the schedule. |
haltOn | The state of the Child Job from the nextDue property when the job begins to execute. |
job | The job to run when it's due. |
lastDue | The time the schedule was lastDue. |
limits | Used to limit the schedule. |
name | A name, can be any text. |
reset | |
schedule | The Schedule used to provide execution times. |
timeZone | The time zone the schedule is to run in. |
Example 1 | File Polling. |
Example 2 | Using Retry with a Timer. |
Configured By | ELEMENT |
Access | READ_WRITE |
Required | Set automatically. |
The clock to use. Tells the current time.
Access | READ_ONLY |
Required | Set automatically. |
This is the current/next result from the schedule. This properties fromDate is used to set the nextDue date for the schedule and it's useNext (normally the same as toDate) property is used to calculate the following new current property after execution. This property is most useful for the Timer to pass limits to the Retry, but is also useful for diagnostics.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | Read only. |
The state of the Child Job from the nextDue property when the job begins to execute.
Configured By | ELEMENT |
Access | WRITE_ONLY |
Required | Yes. |
The job to run when it's due.
Access | READ_ONLY |
Required | Read only. |
The time the schedule was lastDue. This is set from the nextDue property when the job begins to execute.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
Used to limit the schedule. Usually this will be configured to be a parent timer's current interval.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
A name, can be any text.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Configured By | ELEMENT |
Access | READ_WRITE |
Required | Yes. |
The Schedule used to provide execution times.
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | Set automatically. |
The time zone the schedule is to run in. This is the text id of the time zone, such as "Europe/London". More information can be found at TimeZone.
File Polling. Check every 5 seconds for a file.
<oddjob id="this"> <job> <scheduling:retry name="File Polling Example" xmlns:scheduling="http://rgordon.co.uk/oddjob/scheduling" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules"> <schedule> <schedules:interval interval="00:00:05"/> </schedule> <job> <sequential id="look" name="Look for files"> <jobs> <exists file="${this.dir}/work/*.foo" id="check" name="Check File Exists"/> <echo name="Echo to Console">Found ${check.exists[0]}</echo> </jobs> </sequential> </job> </scheduling:retry> </job> </oddjob>
Using Retry with a Timer. A daily job retries twice.
<oddjob xmlns:schedules="http://rgordon.co.uk/oddjob/schedules" xmlns:scheduling="http://rgordon.co.uk/oddjob/scheduling" xmlns:state="http://rgordon.co.uk/oddjob/state"> <job> <scheduling:timer id="timer"> <schedule> <schedules:daily from="08:00"/> </schedule> <job> <scheduling:retry id="retry"> <schedule> <schedules:count count="2"/> </schedule> <job> <state:flag id="flag-job" state="EXCEPTION"/> </job> </scheduling:retry> </job> </scheduling:timer> </job> </oddjob>