ManagedScheduledExecutorService
and related interfaces.@Deprecated 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.
javax.enterprise.concurrent.ManagedScheduledExecutorService
,
AsynchScope
,
Alarm
,
AlarmManagerEvents
,
Scheduler
APPLICATION_NOTIFICATION_EVENT_SOURCE, MAX_LISTENER_SEQUENCE_VALUE, MIN_LISTENER_SEQUENCE_VALUE
Modifier and Type | Method and Description |
---|---|
Alarm |
create(AlarmListener l,
java.lang.Object context,
int milliSeconds)
Deprecated.
Creates a new Alarm.
|
addListener, addListener, getEventTrigger, getEventTrigger, removeListener
Alarm create(AlarmListener l, java.lang.Object context, int milliSeconds) throws java.lang.IllegalArgumentException
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.java.lang.IllegalArgumentException
- This can be thrown if the async bean is an EnterpriseBean.