Lines Matching defs:timer

26 package javax.management.timer;
50 * Provides the implementation of the timer MBean.
51 * The timer MBean sends out an alarm at a specified time
52 * that wakes up all the listeners registered to receive timer notifications.
55 * This class manages a list of dated timer notifications.
57 * When a timer notification is emitted by the timer and becomes obsolete,
58 * it is automatically removed from the list of timer notifications.
59 * <BR>Additional timer notifications can be added into regularly repeating notifications.
64 * <LI>When sending timer notifications, the timer updates the notification sequence number
66 * <LI>The timer service relies on the system date of the host where the <CODE>Timer</CODE> class is loaded.
128 * Table containing all the timer notifications of this timer,
136 * This attribute is used to specify if the timer has to send past notifications after start.
164 * Used to keep the max key value inserted into the timer table.
168 private java.util.Timer timer;
189 * Allows the timer MBean to perform any operations it needs before being registered
194 * @param server The MBean server in which the timer MBean will be registered.
195 * @param name The object name of the timer MBean.
197 * @return The name of the timer MBean registered.
207 * Allows the timer MBean to perform any operations needed after having been
216 * Allows the timer MBean to perform any operations it needs before being unregistered
219 * Stops the timer.
226 "preDeregister", "stop the timer");
228 // Stop the timer.
234 * Allows the timer MBean to perform any operations needed after having been
267 * Starts the timer.
269 * If there is one or more timer notifications before the time in the list of notifications, the notification
272 * If the timer notification date remains earlier than the current date, this notification is just removed
278 "start", "starting the timer");
284 timer = new java.util.Timer();
298 // Here, all the notifications in the timer table are later than the current date.
313 timer.schedule(alarmClock, alarmClock.next);
319 timer.schedule(alarmClock, alarmClock.timeout);
328 "start", "timer started");
331 "start", "the timer is already activated");
336 * Stops the timer.
341 "stop", "stopping the timer");
368 timer.cancel();
375 "stop", "timer stopped");
378 "stop", "the timer is already deactivated");
383 * Creates a new timer notification with the specified <CODE>type</CODE>, <CODE>message</CODE>
387 * If the timer notification to be inserted has a date that is before the current date,
393 * Note that once the timer notification has been added into the list of notifications,
399 * @param type The timer notification type.
400 * @param message The timer notification detailed message.
401 * @param userData The timer notification user data object.
403 * @param period The period of the timer notification (in milliseconds).
404 * @param nbOccurences The total number the timer notification will be emitted.
411 * @return The identifier of the new created timer notification.
431 // Check that all the timer notification attributes are valid.
434 // Invalid timer period value exception:
451 "update timer notification to add with:" +
456 // Create and add the timer notification into the timer table.
461 // when the notification is emitted by the timer.
479 // The date registered into the timer is a clone from the date parameter.
492 .append("adding timer notification:\n\t")
518 timer.schedule(alarmClock, alarmClock.next);
522 timer.schedule(alarmClock, alarmClock.timeout);
527 "addNotification", "timer notification added");
532 * Creates a new timer notification with the specified <CODE>type</CODE>, <CODE>message</CODE>
536 * If the timer notification to be inserted has a date that is before the current date,
542 * Note that once the timer notification has been added into the list of notifications,
549 * @param type The timer notification type.
550 * @param message The timer notification detailed message.
551 * @param userData The timer notification user data object.
553 * @param period The period of the timer notification (in milliseconds).
554 * @param nbOccurences The total number the timer notification will be emitted.
556 * @return The identifier of the new created timer notification.
576 * Creates a new timer notification with the specified <CODE>type</CODE>, <CODE>message</CODE>
580 * The timer notification will repeat continuously using the timer period using a <i>fixed-delay</i>
585 * If the timer notification to be inserted has a date that is before the current date,
590 * @param type The timer notification type.
591 * @param message The timer notification detailed message.
592 * @param userData The timer notification user data object.
594 * @param period The period of the timer notification (in milliseconds).
596 * @return The identifier of the new created timer notification.
614 * Creates a new timer notification with the specified <CODE>type</CODE>, <CODE>message</CODE>
618 * The timer notification will be handled once at the specified date.
620 * If the timer notification to be inserted has a date that is before the current date,
624 * @param type The timer notification type.
625 * @param message The timer notification detailed message.
626 * @param userData The timer notification user data object.
629 * @return The identifier of the new created timer notification.
646 * Removes the timer notification corresponding to the specified identifier from the list of notifications.
648 * @param id The timer notification identifier.
650 * @exception InstanceNotFoundException The specified identifier does not correspond to any timer notification
651 * in the list of notifications of this timer MBean.
655 // Check that the notification to remove is effectively in the timer table.
679 // Remove the timer notification from the timer table.
683 .append("removing timer notification:")
705 "removeNotification", "timer notification removed");
709 * Removes all the timer notifications corresponding to the specified type from the list of notifications.
711 * @param type The timer notification type.
713 * @exception InstanceNotFoundException The specified type does not correspond to any timer notification
714 * in the list of notifications of this timer MBean.
728 * Removes all the timer notifications from the list of notifications
729 * and resets the counter used to update the timer notification identifiers.
755 // Remove all the timer notifications from the timer table.
757 "removeAllNotifications", "removing all timer notifications");
762 "removeAllNotifications", "all timer notifications removed");
768 "removeAllNotifications", "timer notification counter ID reset");
775 * Gets the number of timer notifications registered into the list of notifications.
777 * @return The number of timer notifications.
784 * Gets all timer notification identifiers registered into the list of notifications.
786 * @return A vector of <CODE>Integer</CODE> objects containing all the timer notification identifiers.
787 * <BR>The vector is empty if there is no timer notification registered for this timer MBean.
794 * Gets all the identifiers of timer notifications corresponding to the specified type.
796 * @param type The timer notification type.
799 * timer notifications with the specified <CODE>type</CODE>.
800 * <BR>The vector is empty if there is no timer notifications registered for this timer MBean
820 * Gets the timer notification type corresponding to the specified identifier.
822 * @param id The timer notification identifier.
824 * @return The timer notification type or null if the identifier is not mapped to any
825 * timer notification registered for this timer MBean.
837 * Gets the timer notification detailed message corresponding to the specified identifier.
839 * @param id The timer notification identifier.
841 * @return The timer notification detailed message or null if the identifier is not mapped to any
842 * timer notification registered for this timer MBean.
854 * Gets the timer notification user data object corresponding to the specified identifier.
856 * @param id The timer notification identifier.
858 * @return The timer notification user data object or null if the identifier is not mapped to any
859 * timer notification registered for this timer MBean.
874 * Gets a copy of the date associated to a timer notification.
876 * @param id The timer notification identifier.
879 * timer notification registered for this timer MBean.
892 * Gets a copy of the period (in milliseconds) associated to a timer notification.
894 * @param id The timer notification identifier.
897 * timer notification registered for this timer MBean.
909 * Gets a copy of the remaining number of occurrences associated to a timer notification.
911 * @param id The timer notification identifier.
914 * timer notification registered for this timer MBean.
929 * @param id The timer notification identifier.
945 * Gets the flag indicating whether or not the timer sends past notifications.
957 * Sets the flag indicating whether the timer sends past notifications or not.
969 * Tests whether the timer MBean is active.
970 * A timer MBean is marked active when the {@link #start start} method is called.
974 * @return <CODE>true</CODE> if the timer MBean is active, <CODE>false</CODE> otherwise.
981 * Tests whether the list of timer notifications is empty.
983 * @return <CODE>true</CODE> if the list of timer notifications is empty, <CODE>false</CODE> otherwise.
1012 // Retrieve the timer notification and the date notification.
1018 // Update the timer notification while:
1019 // - the timer notification date is earlier than the current date
1020 // - the timer notification has not been removed from the timer table.
1027 .append("sending past timer notification:")
1048 "sendPastNotifications", "past timer notification sent");
1051 // Update the date and the number of occurrences of the timer notification.
1059 * If the timer notification is not periodic, it is removed from the list of notifications.
1061 * If the timer period of the timer notification has a non null periodicity,
1062 * the date of the timer notification is updated by adding the periodicity.
1065 * If the timer period has a defined number of occurrences, the timer
1069 * @param notifID The timer notification identifier to update.
1073 // Retrieve the timer notification and the TimerAlarmClock.
1084 // Update the date and the number of occurrences of the timer notification
1102 timer.schedule(alarmClock, alarmClock.next);
1108 timer.schedule(alarmClock, alarmClock.timeout);
1114 .append("update timer notification with:")
1172 * This method is called by the timer each time
1183 // Retrieve the timer notification associated to the alarm-clock.
1195 // Notify the timer.
1205 * This method is used by the timer MBean to update and send a timer
1209 * @param notification The timer notification to send.
1215 .append("sending timer notification:")
1239 "sendNotification", "timer notification sent");
1246 * The aim of this MBean is to set up an alarm which wakes up the timer every timeout (fixed-delay)
1279 * This method is called by the timer when it is started.