O'Reilly logo

EJB 3.1 Cookbook by Richard M. Reese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required