KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > quartz > core > SchedulerSignalerImpl


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.core;
23
24 import org.quartz.SchedulerException;
25 import org.quartz.Trigger;
26 import org.quartz.spi.SchedulerSignaler;
27
28 /**
29  * An interface to be used by <code>JobStore</code> instances in order to
30  * communicate signals back to the <code>QuartzScheduler</code>.
31  *
32  * @author jhouse
33  */

34 public class SchedulerSignalerImpl implements SchedulerSignaler {
35
36     /*
37      * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38      *
39      * Data members.
40      *
41      * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42      */

43
44     private QuartzScheduler sched;
45
46     /*
47      * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48      *
49      * Constructors.
50      *
51      * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
52      */

53
54     SchedulerSignalerImpl(QuartzScheduler sched) {
55         this.sched = sched;
56     }
57
58     public void notifyTriggerListenersMisfired(Trigger trigger) {
59         try {
60             sched.notifyTriggerListenersMisfired(trigger);
61         } catch (SchedulerException se) {
62             sched.getLog().error(
63                     "Error notifying listeners of trigger misfire.", se);
64             sched.notifySchedulerListenersError(
65                     "Error notifying listeners of trigger misfire.", se);
66         }
67     }
68
69     /*
70      * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71      *
72      * Interface.
73      *
74      * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75      */

76
77     public void signalSchedulingChange() {
78         sched.notifySchedulerThread();
79     }
80
81 }
82
Popular Tags