A calendar-based timeout expression for an enterprise bean timer.
Each attribute used to define a calendar-based timeout schedule has two overloaded setter methods, one that takes a String and one that takes an int. The int version is merely a convenience method for setting the attribute in the common case that the value is a simple integer value.
For example,
scheduleExpression.second(10)is semantically equivalent to
scheduleExpression.second("10")
There are seven attributes that constitute a schedule specification which are listed below. In addition, the
timezone attribute may be used to specify a non-default time zone in whose context the schedule
specification is to be evaluated.
The attributes that specify the calendar-based schedule itself are as follows:
Allowable values: [0,59]
Allowable values : [0,59]
Allowable values : [0,23]
Allowable values:
"Last" means the last day of the month
-x (where x is in the range [-7, -1]) means x day(s) before the last day of the month
"1st","2nd", etc. applied to a day of the week identifies a single occurrence of that day within the month.
Allowable values :
Allowable values :
"0" and "7" both refer to Sunday
Allowable values : a four-digit calendar year
Each attribute supports values expressed in one of the following forms
Example: second = "10" Example: month = "Sep"
Example: second = "*" Example: dayOfWeek = "*"
Example: second = "10,20,30" Example: dayOfWeek = "Mon,Wed,Fri" Example: minute = "0-10,30,40"
x is larger than y in a range "x-y", the range is
equivalent to "x-max, min-y", where max is the largest value of the corresponding attribute
and min is the smallest. The range "x-x", where both range values are the same, evaluates
to the single value x. The day of the week range "0-7" is equivalent to "*".
Example: second = "1-10" Example: dayOfWeek = "Fri-Mon" Example: dayOfMonth = "27-3" (Equivalent to "27-Last , 1-3")
N seconds, minutes, or hours within the minute, hour, or day, respectively. For the
expression x/y, the attribute is constrained to every yth value within the set of allowable
values beginning at time x. The x value is inclusive. The wild card character
(*) can be used in the x position, and is equivalent to 0. The use of
increments is only supported within the second, minute, and hour attributes.
For the second and minute attributes, x and y must each be in the
range [0,59]. For the hour attribute, x and y must each be in the
range [0,23].
Example: minute = "∗/5" (Every five minutes within the hour)This is equivalent to:
minute = "0,5,10,15,20,25,30,35,40,45,50,55"
Example: second = "30/10" (Every 10 seconds within the minute, starting at second 30)This is equivalent to:
second = "30,40,50"
Note that the set of matching increment values stops once the maximum value for that attribute is exceeded. It does not "roll over" past the boundary.
Example : ( minute = "∗/14", hour="1,2")
This is equivalent to: (minute = "0,14,28,42,56", hour = "1,2") (Every 14 minutes within the hour, for
the hours of 1 and 2 a.m.)
The following additional rules apply to the schedule specification attributes:
dayOfMonth attribute has a non-wildcard value and the dayOfWeek attribute has a
non-wildcard value, then any day matching either the dayOfMonth value or the dayOfWeek
value will be considered to apply.
"Sun", "Jan", "1st", etc.) are case
insensitive.
Schedule-based timer times are evaluated in the context of the default time zone associated with the container in which the application is executing. A schedule-based timer may optionally override this default and associate itself with a specific time zone. If the schedule-based timer is associated with a specific time zone, all its times are evaluated in the context of that time zone, regardless of the default time zone in which the container is executing.
None of the ScheduleExpression methods are required to be called. The defaults are :
Applications must not rely on the getter methods that return the attributes of a calendar-based timeout schedule to
return them in the same syntactic format in which they were passed in to a ScheduleExpression method or
supplied to the Schedule annotation, and portable implementations must not assume any particular
syntactic format. Implementations are required only to preserve semantic equivalence.
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private String | |
| private Date | |
| private String | |
| private String | |
| private String | |
| private String | |
| private static final long | |
| private Date | |
| private String | |
| private String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ScheduleExpression | Returns: ajakarta.ejb.ScheduleExpression object.the attribute value as a d)StringSet the day of the month attribute. |
| public ScheduleExpression | Returns: ajakarta.ejb.ScheduleExpression object.the attribute value as an d)int, if the value is a simple integer valueSet the day of the month attribute. |
| public ScheduleExpression | Returns: ajakarta.ejb.ScheduleExpression object.the attribute value as a d)StringSet the day of the week attribute. |
| public ScheduleExpression | Returns: ajakarta.ejb.ScheduleExpression object.the attribute value as an d)int, if the value is a simple integer valueSet the day of the week attribute. |
| public ScheduleExpression | |
| public String | |
| public String | |
| public Date | |
| public String | |
| public String | |
| public String | |
| public String | |
| public Date | |
| public String | |
| public String | |
| public ScheduleExpression | Returns: ajakarta.ejb.ScheduleExpression object.the attribute value as a h)StringSet the hour attribute. |
| public ScheduleExpression | Returns: ajakarta.ejb.ScheduleExpression object.the attribute value as an h)int, if the value is a simple integer valueSet the hour attribute. |
| public ScheduleExpression | Returns: ajakarta.ejb.ScheduleExpression object.the attribute value as a m)StringSet the minute attribute. |
| public ScheduleExpression | Returns: ajakarta.ejb.ScheduleExpression object.the attribute value as an m)int, if the value is a simple integer valueSet the minute attribute. |
| public ScheduleExpression | Returns: ajakarta.ejb.ScheduleExpression object.the attribute value as a m)StringSet the month attribute. |
| public ScheduleExpression | Returns: ajakarta.ejb.ScheduleExpression object.the attribute value as an m)int, if the value is a simple integer valueSet the month attribute. |
| public ScheduleExpression | Returns: ajakarta.ejb.ScheduleExpression object.the attribute value as a s)StringSet the second attribute. |
| public ScheduleExpression | Returns: ajakarta.ejb.ScheduleExpression object.the attribute value as an s)int, if the value is a simple integer valueSet the second attribute. |
| public ScheduleExpression | |
| public ScheduleExpression | Returns: ajakarta.ejb.ScheduleExpression object.the Time zone specified as an ID String timezoneID)Set the timezone. |
| public String | |
| public ScheduleExpression | Returns: ajakarta.ejb.ScheduleExpression object.the attribute value as a y)StringSet the year attribute. |
| public ScheduleExpression | Returns: ajakarta.ejb.ScheduleExpression object.the attribute value as an y)int, if the value is a simple integer valueSet the year attribute. |
| dayOfMonth_ | back to summary |
|---|---|
| private String dayOfMonth_ | |
| dayOfWeek_ | back to summary |
|---|---|
| private String dayOfWeek_ | |
| end_ | back to summary |
|---|---|
| private Date end_ | |
| hour_ | back to summary |
|---|---|
| private String hour_ | |
| minute_ | back to summary |
|---|---|
| private String minute_ | |
| month_ | back to summary |
|---|---|
| private String month_ | |
| second_ | back to summary |
|---|---|
| private String second_ | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| start_ | back to summary |
|---|---|
| private Date start_ | |
| timezoneID_ | back to summary |
|---|---|
| private String timezoneID_ | |
| year_ | back to summary |
|---|---|
| private String year_ | |
| ScheduleExpression | back to summary |
|---|---|
| public ScheduleExpression() Create a schedule with the default values. | |
| dayOfMonth | back to summary |
|---|---|
| public ScheduleExpression dayOfMonth(String d) Set the day of the month attribute.
| |
| dayOfMonth | back to summary |
|---|---|
| public ScheduleExpression dayOfMonth(int d) Set the day of the month attribute.
| |
| dayOfWeek | back to summary |
|---|---|
| public ScheduleExpression dayOfWeek(String d) Set the day of the week attribute.
| |
| dayOfWeek | back to summary |
|---|---|
| public ScheduleExpression dayOfWeek(int d) Set the day of the week attribute.
| |
| end | back to summary |
|---|---|
| public ScheduleExpression end(Date e) Set the end date.
| |
| getDayOfMonth | back to summary |
|---|---|
| public String getDayOfMonth() Return the value of the day of the month attribute.
| |
| getDayOfWeek | back to summary |
|---|---|
| public String getDayOfWeek() Return the value of the day of the week attribute.
| |
| getEnd | back to summary |
|---|---|
| public Date getEnd() Return the end date, if set; otherwise null.
| |
| getHour | back to summary |
|---|---|
| public String getHour() Return the value of the hour attribute.
| |
| getMinute | back to summary |
|---|---|
| public String getMinute() Return the value of the minute attribute.
| |
| getMonth | back to summary |
|---|---|
| public String getMonth() Return the value of the month attribute.
| |
| getSecond | back to summary |
|---|---|
| public String getSecond() Return the value of the second attribute.
| |
| getStart | back to summary |
|---|---|
| public Date getStart() Return the start date, if set; otherwise null.
| |
| getTimezone | back to summary |
|---|---|
| public String getTimezone() Return the timezone, if set; otherwise null.
| |
| getYear | back to summary |
|---|---|
| public String getYear() Return the value of the year attribute.
| |
| hour | back to summary |
|---|---|
| public ScheduleExpression hour(String h) Set the hour attribute.
| |
| hour | back to summary |
|---|---|
| public ScheduleExpression hour(int h) Set the hour attribute.
| |
| minute | back to summary |
|---|---|
| public ScheduleExpression minute(String m) Set the minute attribute.
| |
| minute | back to summary |
|---|---|
| public ScheduleExpression minute(int m) Set the minute attribute.
| |
| month | back to summary |
|---|---|
| public ScheduleExpression month(String m) Set the month attribute.
| |
| month | back to summary |
|---|---|
| public ScheduleExpression month(int m) Set the month attribute.
| |
| second | back to summary |
|---|---|
| public ScheduleExpression second(String s) Set the second attribute.
| |
| second | back to summary |
|---|---|
| public ScheduleExpression second(int s) Set the second attribute.
| |
| start | back to summary |
|---|---|
| public ScheduleExpression start(Date s) Set the start date.
| |
| timezone | back to summary |
|---|---|
| public ScheduleExpression timezone(String timezoneID) Set the timezone.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| year | back to summary |
|---|---|
| public ScheduleExpression year(String y) Set the year attribute.
| |
| year | back to summary |
|---|---|
| public ScheduleExpression year(int y) Set the year attribute.
| |