Book Image

EJB 3 Developer Guide

By : Michael Sikora
Book Image

EJB 3 Developer Guide

By: Michael Sikora

Overview of this book

Table of Contents (18 chapters)
EJB 3 Developer Guide
Credits
About the Author
About the Reviewers
Preface
Annotations and Their Corresponding Packages

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 in conjunction with stateless session beans or MDBs. Currently timers cannot be used with stateful session beans, although the EJB specification group has indicated that this may be rectified in a future release. As EJB 2.x entity beans are container-managed, they can use timers. However as EJB 3 entities are not container-managed, they cannot use timers.

An EJB creates a timer by invoking the TimerService.createTimer() method. The timer specifies a scheduled event either as...