Understanding calendar-based scheduling

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.

Getting ready

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 ...

Get EJB 3.1 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.