01: /*
02: * Copyright 2004-2005 OpenSymphony
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy
06: * of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations
14: * under the License.
15: *
16: */
17:
18: /*
19: * Previously Copyright (c) 2001-2004 James House
20: */
21: package org.quartz;
22:
23: /**
24: * <p>
25: * The interface to be implemented by classes that want to be informed when a
26: * <code>{@link org.quartz.JobDetail}</code> executes. In general,
27: * applications that use a <code>Scheduler</code> will not have use for this
28: * mechanism.
29: * </p>
30: *
31: * @see Scheduler
32: * @see Job
33: * @see JobExecutionContext
34: * @see JobExecutionException
35: * @see TriggerListener
36: *
37: * @author James House
38: */
39: public interface JobListener {
40:
41: /*
42: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43: *
44: * Interface.
45: *
46: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47: */
48:
49: /**
50: * <p>
51: * Get the name of the <code>JobListener</code>.
52: * </p>
53: */
54: String getName();
55:
56: /**
57: * <p>
58: * Called by the <code>{@link Scheduler}</code> when a <code>{@link org.quartz.JobDetail}</code>
59: * is about to be executed (an associated <code>{@link Trigger}</code>
60: * has occured).
61: * </p>
62: *
63: * <p>
64: * This method will not be invoked if the execution of the Job was vetoed
65: * by a <code>{@link TriggerListener}</code>.
66: * </p>
67: *
68: * @see #jobExecutionVetoed(JobExecutionContext)
69: */
70: void jobToBeExecuted(JobExecutionContext context);
71:
72: /**
73: * <p>
74: * Called by the <code>{@link Scheduler}</code> when a <code>{@link org.quartz.JobDetail}</code>
75: * was about to be executed (an associated <code>{@link Trigger}</code>
76: * has occured), but a <code>{@link TriggerListener}</code> vetoed it's
77: * execution.
78: * </p>
79: *
80: * @see #jobToBeExecuted(JobExecutionContext)
81: */
82: void jobExecutionVetoed(JobExecutionContext context);
83:
84: /**
85: * <p>
86: * Called by the <code>{@link Scheduler}</code> after a <code>{@link org.quartz.JobDetail}</code>
87: * has been executed, and be for the associated <code>Trigger</code>'s
88: * <code>triggered(xx)</code> method has been called.
89: * </p>
90: */
91: void jobWasExecuted(JobExecutionContext context,
92: JobExecutionException jobException);
93:
94: }
|