![]() To specify an absolute time, create a object and pass it to the TimerService.createSingleActionTimer or the TimerService.createTimer method. The duration is expressed as a the number of milliseconds before a timeout event is triggered. These methods allow single-action, interval, or calendar-based timers to be created.įor single-action or interval timers, the expiration of the timer can be expressed as either a duration or an absolute time. To create a timer, the bean invokes one of the create methods of the TimerService interface. The following expression represents every 2 hours starting at noon: hour="12/2" The following expression represents every 10 minutes within the hour: minute="*/10" Intervals may be set only for second, minute, and hour attributes. The wildcard character may be used in the x position of an interval and is equivalent to setting x to 0. For an expression of the form x/y, x represents the starting point and y represents the interval. The forward slash ( /) constrains an attribute to a starting point and an interval and is used to specify every N seconds, minutes, or hours within the minute, hour, or day. It is equivalent to the following expression: dayOfMonth="25-Last,1-5" The following expression represents the twenty-fifth day of the month to the end of the month, and the beginning of the month to the fifth day of the month: dayOfMonth="25-5" The following expression represents Friday through Monday: dayOfWeek="5-1" The following expression represents 9:00 a.m. That is, the expression begins at x, rolls over to the beginning of the allowable values, and continues up to y. A range of the form x-y where x is greater than y is equivalent to the expression x- maximumvalue, minimumvalue -y. A range of the form x-x, is equivalent to the single-valued expression x. Members of a range cannot be wildcards, lists, or intervals. Use a dash character ( -) to specify an inclusive range of values for an attribute. ![]() The following expression represents 4:00 a.m., every hour from 9:00 a.m. The following expression sets the day of the week to Tuesday and Thursday: dayOfWeek="Tue, Thu" Wildcards and intervals, however, are not allowed. A range of values is allowed as part of a list. To specify two or more values for an attribute, use a comma ( ,) to separate the values. The following expression represents every day of the week: dayOfWeek="*" The following expression represents every minute: minute="*" Setting an attribute to an asterisk symbol ( *) represents all allowable values for the attribute. You can specify multiple values in calendar expressions, as described in the following sections. For example: year="2011".ģ4.4.1.1 Specifying Multiple Values in Calendar Expressions For example: month="July".Ī four-digit calendar year. Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec. –7 to –1 (a negative number means the nth day or days before the end of the month). Table 34-1 Calendar-Based Timer Attributes AttributeĠ to 7 (both 0 and 7 refer to Sunday).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |