public class SequenceJob
extends java.lang.Object
implements java.lang.Runnable, java.io.Serializable
<oddjob id="this" xmlns:scheduling="http://rgordon.co.uk/oddjob/scheduling" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules"> <job> <scheduling:timer id="daily"> <schedule> <schedules:daily/> </schedule> <job> <scheduling:timer> <schedule> <schedules:count count="10"/> </schedule> <job> <sequential> <jobs> <sequence id="seqnum" watch="${daily.current}"/> <variables id="vars"> <seqnumFormatted> <format format="0000" number="${seqnum.current}"/> </seqnumFormatted> </variables> <copy name="Create file" to="${work.dir}/sequence${vars.seqnumFormatted}.txt"> <input> <value value="This text will be in every file."/> </input> </copy> </jobs> </sequential> </job> </scheduling:timer> </job> </scheduling:timer> </job> </oddjob>The watch property is set to watch when the daily scheule move forward so the sequence is restarted.
Constructor and Description |
---|
SequenceJob() |
Modifier and Type | Method and Description |
---|---|
java.lang.Integer |
getCurrent()
Get the current sequence number.
|
int |
getFrom() |
java.lang.String |
getName()
Get the name.
|
java.lang.Object |
getWatch() |
void |
run() |
void |
setCurrent(java.lang.Integer current) |
void |
setFrom(int from) |
void |
setName(java.lang.String name)
Set the name
|
void |
setWatch(java.lang.Object watch)
Set an object to watch.
|
java.lang.String |
toString() |
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The name.public java.lang.Integer getCurrent()
public void setCurrent(java.lang.Integer current)
public void setFrom(int from)
public int getFrom()
public void run()
run
in interface java.lang.Runnable
public void setWatch(java.lang.Object watch)
reset
- The reset to set.public java.lang.Object getWatch()
public java.lang.String toString()
toString
in class java.lang.Object