Alarms

An alarm executes Java 2 Enterprise Edition (J2EE) context-aware code at a given time interval. Alarm objects are fine-grained, non-persistent, transient, and can fire at millisecond intervals.

Alarms are executed using a thread pool associated with the work manager that owns the associated asynchronous scope.

The AlarmManager.createAlarm() method takes an application-written object that implements the AlarmListener interface. (For more information on the AlarmListener interface, see the Javadoc )The fired method is called when the alarm expires. The createAlarm() method returns a non-serializable handle, which can be used to cancel or reset the alarm. All of the pending alarms are cancelled when its associated AsynchScope object is destroyed.

The Java 2 Software Development Kit (SDK) already has a timer mechanism, so why create a new one? The Java 2 SDK is a Java 2 Platform Standard Edition (J2SE) feature that knows nothing about the J2EE environment. Timers fired by the J2SE feature do not run on a managed thread and are therefore unusable inside an application server. These timers also lack a J2EE context (that is, a java:comp value) and are not authenticated when they fire. The asynchronous scope alarms are fully supported by the product and have the same properties as any other asynchronous bean.

Alarm performance

The alarm subsystem is designed to handle a large number of alarms. However, do not have alarms undertake heavy processing when they are firing because this activity slows the processing of later alarms. If an alarm needs to process a heavy load, design a work object that is activated by a work manager. This procedure moves the heavy processing to a different thread and enables the alarm threads to process alarms unhampered. All of the alarms owned by asynchronous scopes that are owned by a single work manager, share a common thread pool. The properties of this thread pool can be tuned at the work manager level using the administrative console.


Related tasks
Developing asynchronous scopes



Searchable topic ID:   casb_alarms
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/asyncbns/concepts/casb_alarms.html

Library | Support | Terms of Use | Feedback