KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > scheduling > TriggerScheduleInstruction


1 /*
2  * (c) Rob Gordon 2005
3  */

4 package org.oddjob.scheduling;
5
6 import org.oddjob.Stateful;
7
8 /**
9  * @oddjob.description A trigger schedule runs when the job being triggered
10  * on enters the state specified.
11  * <p>
12  *
13  * @oddjob.example
14  *
15  * <pre>
16  * &lt;chain name="Trigger an Alert"&gt;
17  * &lt;scheduler&gt;
18  * &lt;trigger job="${job2}" on="${job1} state="exception" /&gt;
19  * &lt;/scheduler&gt;
20  * &lt;folder&gt;
21  * &lt;echo id="job1" name="Run me!" /&gt;
22  * &lt;echo id="job2" text="You forgot the text dummy!" /&gt;
23  * &lt;/folder&gt;
24  * &lt;/chain&gt;
25  *
26  * @author Rob Gordon.
27  */

28 public class TriggerScheduleInstruction extends ScheduleInstruction {
29     private static final long serialVersionUID = 20051121;
30     
31     
32     /**
33      * @oddjob.property
34      * @oddjob.description The job the trigger will trigger on.
35      * @oddjob.required Yes.
36      */

37     private Stateful on;
38     
39     /**
40      * @oddjob.property
41      * @oddjob.description The state which will cause the trigger
42      * to fire.
43      * @oddjob.required No, defaults to COMPLETE.
44      */

45     private String JavaDoc state;
46     
47     public Stateful getOn() {
48         return on;
49     }
50
51     public void setOn(Stateful triggerOn) {
52         this.on = triggerOn;
53     }
54
55     public String JavaDoc getState() {
56         return state;
57     }
58
59     public void setState(String JavaDoc state) {
60         this.state = state;
61     }
62 }
63
Popular Tags