001: /*
002: * Copyright 2004-2005 OpenSymphony
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005: * use this file except in compliance with the License. You may obtain a copy
006: * of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013: * License for the specific language governing permissions and limitations
014: * under the License.
015: *
016: */
017:
018: /*
019: * Previously Copyright (c) 2001-2004 James House
020: */
021: package org.quartz;
022:
023: /**
024: * <p>
025: * The interface to be implemented by classes that want to be informed of major
026: * <code>{@link Scheduler}</code> events.
027: * </p>
028: *
029: * @see Scheduler
030: * @see JobListener
031: * @see TriggerListener
032: *
033: * @author James House
034: */
035: public interface SchedulerListener {
036:
037: /*
038: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
039: *
040: * Interface.
041: *
042: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
043: */
044:
045: /**
046: * <p>
047: * Called by the <code>{@link Scheduler}</code> when a <code>{@link org.quartz.JobDetail}</code>
048: * is scheduled.
049: * </p>
050: */
051: void jobScheduled(Trigger trigger);
052:
053: /**
054: * <p>
055: * Called by the <code>{@link Scheduler}</code> when a <code>{@link org.quartz.JobDetail}</code>
056: * is unscheduled.
057: * </p>
058: */
059: void jobUnscheduled(String triggerName, String triggerGroup);
060:
061: /**
062: * <p>
063: * Called by the <code>{@link Scheduler}</code> when a <code>{@link Trigger}</code>
064: * has reached the condition in which it will never fire again.
065: * </p>
066: */
067: void triggerFinalized(Trigger trigger);
068:
069: /**
070: * <p>
071: * Called by the <code>{@link Scheduler}</code> when a <code>{@link Trigger}</code>
072: * or group of <code>{@link Trigger}s</code> has been paused.
073: * </p>
074: *
075: * <p>
076: * If a group was paused, then the <code>triggerName</code> parameter
077: * will be null.
078: * </p>
079: */
080: void triggersPaused(String triggerName, String triggerGroup);
081:
082: /**
083: * <p>
084: * Called by the <code>{@link Scheduler}</code> when a <code>{@link Trigger}</code>
085: * or group of <code>{@link Trigger}s</code> has been un-paused.
086: * </p>
087: *
088: * <p>
089: * If a group was resumed, then the <code>triggerName</code> parameter
090: * will be null.
091: * </p>
092: */
093: void triggersResumed(String triggerName, String triggerGroup);
094:
095: /**
096: * <p>
097: * Called by the <code>{@link Scheduler}</code> when a <code>{@link org.quartz.JobDetail}</code>
098: * or group of <code>{@link org.quartz.JobDetail}s</code> has been
099: * paused.
100: * </p>
101: *
102: * <p>
103: * If a group was paused, then the <code>jobName</code> parameter will be
104: * null. If all jobs were paused, then both parameters will be null.
105: * </p>
106: */
107: void jobsPaused(String jobName, String jobGroup);
108:
109: /**
110: * <p>
111: * Called by the <code>{@link Scheduler}</code> when a <code>{@link org.quartz.JobDetail}</code>
112: * or group of <code>{@link org.quartz.JobDetail}s</code> has been
113: * un-paused.
114: * </p>
115: *
116: * <p>
117: * If a group was resumed, then the <code>jobName</code> parameter will
118: * be null. If all jobs were paused, then both parameters will be null.
119: * </p>
120: */
121: void jobsResumed(String jobName, String jobGroup);
122:
123: /**
124: * <p>
125: * Called by the <code>{@link Scheduler}</code> when a serious error has
126: * occured within the scheduler - such as repeated failures in the <code>JobStore</code>,
127: * or the inability to instantiate a <code>Job</code> instance when its
128: * <code>Trigger</code> has fired.
129: * </p>
130: *
131: * <p>
132: * The <code>getErrorCode()</code> method of the given SchedulerException
133: * can be used to determine more specific information about the type of
134: * error that was encountered.
135: * </p>
136: */
137: void schedulerError(String msg, SchedulerException cause);
138:
139: /**
140: * <p>
141: * Called by the <code>{@link Scheduler}</code> to inform the listener
142: * that it has shutdown.
143: * </p>
144: */
145: void schedulerShutdown();
146:
147: }
|