KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > quartz > listeners > TriggerListenerSupport


1 /*
2  * Copyright 2004-2006 OpenSymphony
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy
6  * of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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, JobExecutionContext context) {
53     }
54
55     public boolean vetoJobExecution(Trigger trigger, JobExecutionContext context) {
56         return false;
57     }
58
59     public void triggerMisfired(Trigger trigger) {
60     }
61
62     public void triggerComplete(
63         Trigger trigger,
64         JobExecutionContext context,
65         int triggerInstructionCode) {
66     }
67 }
68
Popular Tags