Chapter 9. EJB Timer Service

EJB provides a basic scheduling capability, the timer service. In this chapter we will cover:

  • The EJB timer service

  • A single event example

  • An interval event example

  • The Timer interface

  • Timers and transactions

Introduction

Most enterprises use operating system schedulers, such as the Unix Cron, for scheduling business processes to run at a fixed point in time or at intervals. Typically these are batch or workflow processes. A scheduling capability is provided for EJBs; the difference being that EJBs initiate the scheduler and that the business process is encapsulated as an EJB method. Of course, with EJB timers, you also have platform independence.

Because the EJB timer service is a container-managed service, it can be used ...

Get EJB 3 Developer Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.