01: /*
02: * Copyright 2004-2006 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: package org.quartz.listeners;
17:
18: import org.apache.commons.logging.Log;
19: import org.apache.commons.logging.LogFactory;
20: import org.quartz.TriggerListener;
21: import org.quartz.Trigger;
22: import org.quartz.JobExecutionContext;
23:
24: /**
25: * A helpful abstract base class for implementors of
26: * <code>{@link org.quartz.TriggerListener}</code>.
27: *
28: * <p>
29: * The methods in this class are empty so you only need to override the
30: * subset for the <code>{@link org.quartz.TriggerListener}</code> events
31: * you care about.
32: * </p>
33: *
34: * <p>
35: * You are required to implement <code>{@link org.quartz.TriggerListener#getName()}</code>
36: * to return the unique name of your <code>TriggerListener</code>.
37: * </p>
38: *
39: * @see org.quartz.TriggerListener
40: */
41: public abstract class TriggerListenerSupport implements TriggerListener {
42: private final Log log = LogFactory.getLog(getClass());
43:
44: /**
45: * Get the <code>{@link org.apache.commons.logging.Log}</code> for this
46: * class's category. This should be used by subclasses for logging.
47: */
48: protected Log getLog() {
49: return log;
50: }
51:
52: public void triggerFired(Trigger trigger,
53: JobExecutionContext context) {
54: }
55:
56: public boolean vetoJobExecution(Trigger trigger,
57: JobExecutionContext context) {
58: return false;
59: }
60:
61: public void triggerMisfired(Trigger trigger) {
62: }
63:
64: public void triggerComplete(Trigger trigger,
65: JobExecutionContext context, int triggerInstructionCode) {
66: }
67: }
|