ManagedScheduledExecutorService
and related interfaces.@Deprecated
public interface Alarm
Alarms are transient and not transactional and run inside the JVM which created them. If a cluster wide scheduled event is required or it needs to be persistent,transactional or recoverable then the Scheduler should be used instead.
javax.enterprise.concurrent.ManagedScheduledExecutorService
,
AlarmManager
,
AlarmListener
,
Scheduler
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Deprecated.
This cancels the alarm that is currently pending.
|
AlarmListener |
getAlarmListener()
Deprecated.
This returns the application supplied AlarmListener associated
with this alarm.
|
java.lang.Object |
getContext()
Deprecated.
This returns the context object associated with the alarm
when it was created.
|
void |
reset(int milliSeconds)
Deprecated.
This cancels the current alarm and reschedules it to fire
at a later time.
|
java.lang.Object getContext()
java.lang.IllegalStateException
- If the owner AsynchScope is destroyed.void reset(int milliSeconds)
milliSeconds
- The number of milliseconds from now that the
alarm will fire in.java.lang.IllegalStateException
- If the owner AsynchScope is destroyed.void cancel()
Once cancel is called then an application must not use the alarm instance again as it will be reused by a subsequent alarm.
If the owning AsynchScope was destroyed then this method does not throw IllegalState as the alarm is already cancelled.
AlarmListener getAlarmListener()
java.lang.IllegalStateException
- If the owner AsynchScope is destroyed.