Developing Enterprise JavaBeans 2.1 for the timer service

About this task

In WebSphere Application Server, the EJB Timer Service implements EJB Timers as a new kind of Scheduler Service task. By default, an internal or pre-configured scheduler instance is used to manage those tasks, and they are persisted to a Cloudscape database associated with the server process.

However, you can perform some basic customization to the internal scheduler instance. For information about how to do this customization, see Configuring a Timer Service.

Creation and cancellation of Timer objects are transactional and persistent. That is, if a Timer object is created within a transaction and that transaction is later rolled back, the Timer object's creation is rolled back as well. Similar rules apply to the cancellation of a Timer object. Timer objects also survive across application server shutdowns and restarts.

Procedure

  1. Write your enterprise bean to implement the javax.ejb.TimedObject interface, including the ejbTimeout() method. The bean calls the EJBContext.getTimerService() method to get an instance of the TimerServiceobject. The bean calls the TimerService method to create a Timer. This Timer is now associated with that bean.
  2. After you create it, you can pass the Timer instance to other Java code as a local object.
    Note: For WebSphere Application Server Version 6, no assembly tooling supports the Enterprise JavaBeans timedObject. To set the ejbTimeout method transaction attribute you must manually enter the attributes in the deployment descriptor. See EJB Timer Service settings for more information.



In this information ...


Related information

IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic Task topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Aug 31, 2013 12:02:36 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=pix&product=was-nd-zos&topic=tejb_timerserviceejb
File name: tejb_timerserviceejb.html