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