Calendar-based scheduling is used with the
@Schedule annotation and with the ScheduleExpression
class. It provides an alternative approach for specifying the time when a callback should be made. The calendar-based timer expressions are similar to those used by the UNIX Cron facility.
Using a calendar expression we can express one of several types of events:
A single event in time
A repeating set of times
A time interval
This approach provides a more powerful technique for expressing a point in time.
A calendar expression can be expressed using the @Schedule annotation or using a ScheduleExpression
object. These two approaches are closely related. In fact, the Timer
class has an isCalendarTimer
and a getSchedule
method. If the timer was created using calendar scheduling, then the
getSchedule
method returns a
ScheduleExpression
object representing the schedule. These methods are illustrated in the Using the timer interface recipe.
The @Schedule...