com.ibm.websphere.asynchbeans
Interface AlarmManager
All Superinterfaces:
- public interface AlarmManager
- extends EventSource
This can generate events. The events which can be generated are documented in the AlarmManagerEvents interface. Implement the Events interface and add an instance of this object using the AlarmManager.addListener method.
These Alarms are always executed in the same JVM as the thread that created the Alarm. The Alarms are transient and if the server fails then they are lost irrecoverably. The Scheduler should be used if a cluster wide event needs to be scheduled and needs to be guaranteed to run once in the cluster.
See Also:
Field Summary
Fields inherited from interface com.ibm.websphere.asynchbeans.EventSource |
---|
APPLICATION_NOTIFICATION_EVENT_SOURCE, MAX_LISTENER_SEQUENCE_VALUE, MIN_LISTENER_SEQUENCE_VALUE |
Method Summary
Modifier and Type | Method and Description |
---|---|
create(AlarmListener l,java.lang.Object context,int milliSeconds)
Creates a new Alarm.
|
Methods inherited from interface com.ibm.websphere.asynchbeans.EventSource |
---|
addListener, addListener, getEventTrigger, getEventTrigger, removeListener |
Method Detail
create
- Alarm create(AlarmListener l,
- java.lang.Object context,
- int milliSeconds)
- throws java.lang.IllegalArgumentException
Creates a new Alarm.
It fires after an interval and calls the fired method of the
listener. The listeners is called using the context of
the alarm creator.
Parameters:
l
- The target for the Alarm. The fired method on this is called
when the alarm is fired. context
- The context object for the alarm. This is useful
for supplying alarm specific data to the listener and allows one
listener to be created and used for multiple alarms. milliSeconds
- The alarm will fire in this many milliseconds. Returns:
The actual Alarm. The Alarm object allows you to cancel or
reschedule the alarm at a later point.
Throws:
java.lang.IllegalArgumentException
- This can be thrown if the async bean is an EnterpriseBean.