Interface AlarmManager

  • All Superinterfaces:

    Interfaces for alarms and alarm management are replaced by ManagedScheduledExecutorService and related interfaces.

    public interface AlarmManager
    extends EventSource
    This manages a set of logical alarms. If we destroy it then all the logical alarms created using this alarm manager are cancelled. It is always associated with a WorkManager. The WorkManager dictates the configuration of the AlarmManager as well as which J2EE contexts from Alarm creators are used when an alarm is fired.

    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:
    javax.enterprise.concurrent.ManagedScheduledExecutorService, AsynchScope, Alarm, AlarmManagerEvents, Scheduler
    • 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.
        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.
        The actual Alarm. The Alarm object allows you to cancel or reschedule the alarm at a later point.
        java.lang.IllegalArgumentException - This can be thrown if the async bean is an EnterpriseBean.
IBM WebSphere Application ServerTM
Release 9.0