KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > cornerstone > services > scheduler > TimeScheduler


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12  * implied.
13  *
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 package org.apache.avalon.cornerstone.services.scheduler;
19
20 import java.util.NoSuchElementException JavaDoc;
21
22 /**
23  * This service provides a way to regularly schedule jobs.
24  *
25  * @author <a HREF="mailto:dev@avalon.apache.org">Avalon Development Team</a>
26  */

27 public interface TimeScheduler
28 {
29     String JavaDoc ROLE = TimeScheduler.class.getName();
30
31     /**
32      * Schedule a time based trigger.
33      * Note that if a TimeTrigger already has same name then it is removed.
34      *
35      * @param name the name of the trigger
36      * @param trigger the trigger
37      * @param target the target
38      */

39     void addTrigger( String JavaDoc name, TimeTrigger trigger, Target target );
40
41     /**
42      * Remove a scheduled trigger by name.
43      *
44      * @param name the name of the trigger
45      * @exception NoSuchElementException if no trigger exists with that name
46      */

47     void removeTrigger( String JavaDoc name )
48         throws NoSuchElementException JavaDoc;
49
50     /**
51      * Force a trigger time to be recalculated.
52      *
53      * @param name the name of the trigger
54      * @exception NoSuchElementException if no trigger exists with that name
55      */

56     void resetTrigger( String JavaDoc name )
57         throws NoSuchElementException JavaDoc;
58
59     /**
60      * Add a trigger failure listener
61      * @param listener the listener
62      */

63     void addTriggerFailureListener( TriggerFailureListener listener );
64
65     /**
66      * Remove a trigger failure listener
67      * @param listener the listener
68      */

69     void removeTriggerFailureListener( TriggerFailureListener listener );
70
71 }
72
Popular Tags