KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > rift > coad > daemon > timer > Timer


1 /*
2  * Timer: The timer class
3  * Copyright (C) 2006-2007 Rift IT Contracting
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * TimerInterface.java
20  */

21
22 // the package path
23
package com.rift.coad.daemon.timer;
24
25 // the java imports
26
import java.io.Serializable JavaDoc;
27 import java.rmi.Remote JavaDoc;
28 import java.rmi.RemoteException JavaDoc;
29 import java.util.ArrayList JavaDoc;
30
31
32 /**
33  * The timer interface, supplies a means to add events for a specific target
34  * defined by JNDI.
35  *
36  * @author Glynn Chaldecott
37  */

38 public interface Timer extends Remote JavaDoc {
39     
40     /**
41      * This method is called in order to register an event on the database.
42      *
43      * @param JNDI This is a string for the JNDI of the daemon that is to be
44      * called by the event.
45      * @param month The month of the event. -1 will occur monthly.
46      * @param day The day of the event. -1 will occur daily.
47      * @param hour The hour of the event. -1 will occur hourly.
48      * @param minute The minute of the event. -1 will occur every minute.
49      * @param event This is a serializable object used to identify an individual
50      * event.
51      * @param recure The value of this indicates whether an event will occur
52      * more then once of be deleted from the database after a single
53      * occurence. True will cause it to recure, false will result in it
54      * being deleted after a single occurence
55      */

56     public void register(String JavaDoc JNDI, int month, int day, int hour, int minute,
57             Serializable JavaDoc event, boolean recure)
58             throws RemoteException JavaDoc, TimerException;
59     
60     /**
61      * This method returns a list of all the events currently stored in the
62      * database.
63      *
64      * @return The method returns a List of TimerEvent objects. The TimerEvent
65      * object contains all the properties of an event from the
66      * database.
67      */

68     public TimerEvent[] listEvents() throws RemoteException JavaDoc, TimerException;
69     
70     
71     /**
72      * This method deletes an event based on a supplied event ID which
73      * corresponds to the database ID.
74      *
75      * @param eventID The database ID of the event.
76      */

77     public void deleteEvent(int eventId) throws RemoteException JavaDoc, TimerException;
78 }
79
Popular Tags