KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > quartz > SchedulerListener


1
2 /*
3  * Copyright 2004-2005 OpenSymphony
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6  * use this file except in compliance with the License. You may obtain a copy
7  * of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14  * License for the specific language governing permissions and limitations
15  * under the License.
16  *
17  */

18
19 /*
20  * Previously Copyright (c) 2001-2004 James House
21  */

22 package org.quartz;
23
24 /**
25  * <p>
26  * The interface to be implemented by classes that want to be informed of major
27  * <code>{@link Scheduler}</code> events.
28  * </p>
29  *
30  * @see Scheduler
31  * @see JobListener
32  * @see TriggerListener
33  *
34  * @author James House
35  */

36 public interface SchedulerListener {
37
38     /*
39      * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40      *
41      * Interface.
42      *
43      * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44      */

45
46     /**
47      * <p>
48      * Called by the <code>{@link Scheduler}</code> when a <code>{@link org.quartz.JobDetail}</code>
49      * is scheduled.
50      * </p>
51      */

52     void jobScheduled(Trigger trigger);
53
54     /**
55      * <p>
56      * Called by the <code>{@link Scheduler}</code> when a <code>{@link org.quartz.JobDetail}</code>
57      * is unscheduled.
58      * </p>
59      */

60     void jobUnscheduled(String JavaDoc triggerName, String JavaDoc triggerGroup);
61
62     /**
63      * <p>
64      * Called by the <code>{@link Scheduler}</code> when a <code>{@link Trigger}</code>
65      * has reached the condition in which it will never fire again.
66      * </p>
67      */

68     void triggerFinalized(Trigger trigger);
69
70     /**
71      * <p>
72      * Called by the <code>{@link Scheduler}</code> when a <code>{@link Trigger}</code>
73      * or group of <code>{@link Trigger}s</code> has been paused.
74      * </p>
75      *
76      * <p>
77      * If a group was paused, then the <code>triggerName</code> parameter
78      * will be null.
79      * </p>
80      */

81     void triggersPaused(String JavaDoc triggerName, String JavaDoc triggerGroup);
82
83     /**
84      * <p>
85      * Called by the <code>{@link Scheduler}</code> when a <code>{@link Trigger}</code>
86      * or group of <code>{@link Trigger}s</code> has been un-paused.
87      * </p>
88      *
89      * <p>
90      * If a group was resumed, then the <code>triggerName</code> parameter
91      * will be null.
92      * </p>
93      */

94     void triggersResumed(String JavaDoc triggerName, String JavaDoc triggerGroup);
95
96     /**
97      * <p>
98      * Called by the <code>{@link Scheduler}</code> when a <code>{@link org.quartz.JobDetail}</code>
99      * or group of <code>{@link org.quartz.JobDetail}s</code> has been
100      * paused.
101      * </p>
102      *
103      * <p>
104      * If a group was paused, then the <code>jobName</code> parameter will be
105      * null. If all jobs were paused, then both parameters will be null.
106      * </p>
107      */

108     void jobsPaused(String JavaDoc jobName, String JavaDoc jobGroup);
109
110     /**
111      * <p>
112      * Called by the <code>{@link Scheduler}</code> when a <code>{@link org.quartz.JobDetail}</code>
113      * or group of <code>{@link org.quartz.JobDetail}s</code> has been
114      * un-paused.
115      * </p>
116      *
117      * <p>
118      * If a group was resumed, then the <code>jobName</code> parameter will
119      * be null. If all jobs were paused, then both parameters will be null.
120      * </p>
121      */

122     void jobsResumed(String JavaDoc jobName, String JavaDoc jobGroup);
123
124     /**
125      * <p>
126      * Called by the <code>{@link Scheduler}</code> when a serious error has
127      * occured within the scheduler - such as repeated failures in the <code>JobStore</code>,
128      * or the inability to instantiate a <code>Job</code> instance when its
129      * <code>Trigger</code> has fired.
130      * </p>
131      *
132      * <p>
133      * The <code>getErrorCode()</code> method of the given SchedulerException
134      * can be used to determine more specific information about the type of
135      * error that was encountered.
136      * </p>
137      */

138     void schedulerError(String JavaDoc msg, SchedulerException cause);
139
140     /**
141      * <p>
142      * Called by the <code>{@link Scheduler}</code> to inform the listener
143      * that it has shutdown.
144      * </p>
145      */

146     void schedulerShutdown();
147
148 }
149
Popular Tags