Timer.java | Class | Provides the implementation of the timer MBean.
The timer MBean sends out an alarm at a specified time
that wakes up all the listeners registered to receive timer notifications.
This class manages a list of dated timer notifications.
A method allows users to add/remove as many notifications as required.
When a timer notification is emitted by the timer and becomes obsolete,
it is automatically removed from the list of timer notifications.
Additional timer notifications can be added into regularly repeating notifications.
Note:
- All notifications before the time when the
addNotification method is called
are ignored, irrespective of the sendPastNotifications flag.
- When sending timer notifications, the timer updates the notification sequence number
irrespective of the notification type.
- The timer service relies on the system date of the host where the
Timer class is loaded.
Listeners may receive untimely notifications
if their host has a different system date.
To avoid such problems, synchronize the system date of all host machines where timing is needed.
- The default behaviour for periodic notifications is fixed-delay execution, as
specified in
java.util.Timer .
|