KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > services > scheduler > FixedRateTaskConfiguration


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.services.scheduler;
19
20 import org.sape.carbon.core.util.calendar.DayOfWeekEnum;
21 import org.sape.carbon.core.util.calendar.MonthEnum;
22
23 /**
24  * <p>
25  * This is the configuration interface used to create fixed rate tasks within
26  * the Scheduler Service. Fixed rate tasks are scheduled to execute at fixed
27  * times (e.g. every hour on the hour or every day at 3:30 AM). Available rates
28  * are mintutely, hourly, daily, weekly, monthly (every 30 days), and
29  * annually (every 365 days). The same task can be scheduled multiple times
30  * to achieve rates in between (e.g. twice a day). If the frequency of the
31  * task execution is more important than when the task executes, a fixed
32  * delay task may be more appropriate. Also see java.util.Timer for a
33  * definition of fixed rate.
34  * </p>
35  * <p>
36  * Valid values for Minute are 0 to 59 inclusive.
37  * Valid values for Hour are 0 to 23 inclusive (note no AM or PM). Valid
38  * values for DayOfMonth are 1 to 31 inclusive. Month is specified by
39  * org.sape.carbon.core.util.calendar.MonthEnum. DayOfWeek is specified by
40  * org.sape.carbon.core.util.calendar.DayOfWeekEnum.
41  * </p>
42  * <p>
43  * The scheduling behavior of FixedRateTasks are as follows:
44  * <ul>
45  * <li>
46  * If Minute is not specifed, the task is schedule to start at the beginning
47  * of each minute. An InvalidConfiguraitonException is thrown if
48  * other configuration information is specified.
49  * </li>
50  * <li>
51  * If Minute is specifed, but Hour is not, the task is scheduled to run hourly
52  * at the minute specifed by Minute. An InvalidConfiguraitonException is thrown
53  * if any of DayOfMonth, Month, and DayOfWeek are specifed.
54  * </li>
55  * <li>
56  * If Minute and Hour are specifed, but DayOfWeek and DayOfMonth are not,
57  * the task is scheduled to run daily at the specified time.
58  * An InvalidConfiguraitonException is thrown if Month is specifed.
59  * </li>
60  * <li>
61  * If Minute, Hour, and DayOfMonth are specifed, but Month is not, the task
62  * is scheduled to run every 30 days starting at the specified day and time.
63  * An InvalidConfiguraitonException is thrown if DayOfWeek is specifed.
64  * </li>
65  * <li>
66  * If Minute, Hour, DayOfMonth, and Month are specifed, the task is scheduled
67  * to run every 365 days starting at the specified date and time.
68  * An InvalidConfiguraitonException is thrown if DayOfWeek is specifed.
69  * </li>
70  * <li>
71  * If Minute, Hour, and DayOfWeek are specifed, but DayOfMonth and Month are
72  * not, the task is scheduled to run every 7 days starting at the specified
73  * day and time.
74  * An InvalidConfiguraitonException is thrown if Month is specifed.
75  * </li>
76  * </p>
77  *
78  * @see org.sape.carbon.services.scheduler.FixedDelayTaskConfiguration
79  * @see org.sape.carbon.services.scheduler.ScheduleService
80  * @see org.sape.carbon.core.util.calendar.DayOfWeekEnum
81  * @see org.sape.carbon.core.util.calendar.MonthEnum
82  * @see java.util.GregorianCalendar
83  * @see java.util.Timer#scheduleAtFixedRate(java.util.TimerTask,java.util.Date,long)
84  *
85  * Copyright 2002 Sapient
86  * @since carbon 1.0
87  * @author Douglas Voet, June 2002
88  * @version $Revision: 1.4 $($Author: dvoet $ / $Date: 2003/05/05 21:21:33 $)
89  */

90 public interface FixedRateTaskConfiguration extends BaseTaskConfiguration {
91     /**
92      * Gets the minute value this task will execute on.
93      *
94      * @return minute value this task will execute on
95      */

96     Integer JavaDoc getMinute();
97
98     /**
99      * Sets the minute value this task will execute on.
100      *
101      * @param minute minute value this task will execute on
102      */

103     void setMinute(Integer JavaDoc minute);
104
105     /**
106      * Gets the hour value this task will execute on.
107      *
108      * @return hour value this task will execute on
109      */

110     Integer JavaDoc getHour();
111
112     /**
113      * Sets the hour value this task will execute on.
114      *
115      * @param hour hour value this task will execute on
116      */

117     void setHour(Integer JavaDoc hour);
118
119     /**
120      * Gets the day of the month this task will execute on.
121      *
122      * @return day of the month this task will execute on
123      */

124     Integer JavaDoc getDayOfMonth();
125
126     /**
127      * Sets the day of the month this task will execute on.
128      *
129      * @param dayOfMonth day of the month this task will execute on
130      */

131     void setDayOfMonth(Integer JavaDoc dayOfMonth);
132
133     /**
134      * Gets the month this task will execute on.
135      *
136      * @return month this task will execute on
137      */

138     MonthEnum getMonth();
139
140     /**
141      * Sets the month this task will execute on.
142      *
143      * @param month month this task will execute on
144      */

145     void setMonth(MonthEnum month);
146
147     /**
148      * Gets the day of week this task will execute on.
149      *
150      * @return day of week this task will execute on
151      */

152     DayOfWeekEnum getDayOfWeek();
153
154     /**
155      * Sets the day of week this task will execute on.
156      *
157      * @param dayOfWeek day of week this task will execute on
158      */

159     void setDayOfWeek(DayOfWeekEnum dayOfWeek);
160
161 }
162
Popular Tags