Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.management.timer
Interface TimerMBean

All Known Implementing Classes:
  Timer

public abstract interface TimerMBean

This interface exposes the management interface of the Timer MBean.

Method Summary
`void` | `addNotification(Notification notification, java.util.Date date)` Inserts the specified timer notification into the list of notifications with a given date and a null period and number of repetitions.
`void` | `addNotification(Notification notification, java.util.Date date, long periodInMillis)` Inserts the specified timer notification into the list of notifications with a given date and period and a null number of repetitions.
`void` | `addNotification(Notification notification, java.util.Date date, long periodInMillis, long nbRepetitions)` Inserts the specified timer notification into the list of notifications with a given date, period and number of repetitions.
`java.util.Date` | `getDate(int index)` Gets a copy of the date of the timer notification at the specified index.
`java.util.Date` | `getDate(Notification notification)` Gets a copy of the date of the specified timer notification.
`int` | `getNbNotifications()` Gets the number of notifications registered into the list of notifications.
`java.lang.Long` | `getNbRepetitions(int index)` Gets a copy of the remaining number of repetitions of the timer notification at the specified index.
`java.lang.Long` | `getNbRepetitions(Notification notification)` Gets a copy of the remaining number of repetitions of the specified timer notification.
`Notification[]` | `getNotifications()` Gets all the notifications registered into the list of notifications.
`java.lang.Long` | `getPeriodInMillis(int index)` Gets a copy of the period in milliseconds of the timer notification at the specified index.
`java.lang.Long` | `getPeriodInMillis(Notification notification)` Gets a copy of the period in milliseconds of the specified timer notification.
`boolean` | `getSendPastNotifications()` Gets the flag indicating if the Timer sends past notifications or not.
`boolean` | `isActive()` Tests if the Timer MBean is active.
`boolean` | `isEmpty()` Tests if the list of notifications is empty.
`void` | `removeAllNotifications()` Removes all the notifications from the list of notifications.
`void` | `removeNotification(int index)` Removes the timer notification at the specified index from the list of notifications.
`void` | `removeNotification(Notification notification)` Removes the specified timer notification from the list of notifications.
`void` | `setSendPastNotifications(boolean value)` Sets the flag indicating if the Timer sends past notifications or not.
`void` | `start()` Starts the Timer.
`void` | `stop()` Stops the Timer.

Method Detail

### start

    public void start()

  Starts the Timer.

### stop

    public void stop()

  Stops the Timer.

### addNotification

    public void addNotification(Notification notification,
                                java.util.Date date,
                                long periodInMillis,
                                long nbRepetitions)
                         throws InstanceAlreadyExistsException,
                                java.lang.IllegalArgumentException

  Inserts the specified timer notification into the list of notifications with a given date, period and number of repetitions.

  If the timer notification to be inserted has a date that is before the current date, the method attempts to update the notification using the defined period. If the defined period is null then the method generates an exception.

  If the timer notification has a non null period, the date of the notification is updated by adding the period until the notification date is later than the current date. Then the timer notification is inserted into the list of notifications.

  If the specified number of repetitions is non null, the previous mechanism is employed. The number of times that the period is added is limited to the specified number of repetitions. If the notification date remains earlier than the current date, an exception is generated.

  A specified timer notification can be added only once.

  Note that once the timer notification has been added into the list of notifications, its associated date, period and number of repetitions cannot be updated.

  Parameters:
    `notification` - The timer notification to be added.
    `date` - The date when the notification occurs.
    `periodInMillis` - The period of the timer notification.
    `nbRepetitions` - The number of repetitions of the timer notification.
  Throws:
    InstanceAlreadyExistsException - The timer notification to add is already in the list of notifications.
    java.lang.IllegalArgumentException - The period or the number of repetitions is negative or the date notification is before the current date.

### addNotification

    public void addNotification(Notification notification,
                                java.util.Date date,
                                long periodInMillis)
                         throws InstanceAlreadyExistsException,
                                java.lang.IllegalArgumentException

  Inserts the specified timer notification into the list of notifications with a given date and period and a null number of repetitions.

  The timer notification will repeat continuously using the timer period.

  Parameters:
    `notification` - The timer notification to be added.
    `date` - The date when the notification occurs.
    `periodInMillis` - The period of the timer notification.
  Throws:
    InstanceAlreadyExistsException - The timer notification to add is already in the list of notifications.
    java.lang.IllegalArgumentException - The period is negative or the date notification is before the current date.

### addNotification

    public void addNotification(Notification notification,
                                java.util.Date date)
                         throws InstanceAlreadyExistsException,
                                java.lang.IllegalArgumentException

  Inserts the specified timer notification into the list of notifications with a given date and a null period and number of repetitions.

  The timer notification will be handled once at the specified date.

  Parameters:
    `notification` - The timer notification to be added.
    `date` - The date when the notification occurs.
  Throws:
    InstanceAlreadyExistsException - The timer notification to add is already in the list of notifications.
    java.lang.IllegalArgumentException - The date notification is before the current date.

### removeNotification

    public void removeNotification(Notification notification)
                            throws InstanceNotFoundException

  Removes the specified timer notification from the list of notifications. If the object is found in this list, each component in the list with an index greater or equal to the object's index is shifted downward to have an index one smaller than the value it had previously.
  Parameters:
    `notification` - The timer notification to be removed.
  Throws:
    InstanceNotFoundException - The timer notification to remove is not in the list of notifications.

### removeNotification

    public void removeNotification(int index)
                            throws InstanceNotFoundException

  Removes the timer notification at the specified index from the list of notifications. Each component in this list with an index greater or equal to the specified index is shifted downward to have an index one smaller than the value it had previously.
  Parameters:
    `index` - The index of the timer notification to remove.
  Throws:
    InstanceNotFoundException - The index is invalid.

### removeAllNotifications

    public void removeAllNotifications()

  Removes all the notifications from the list of notifications.

### getNotifications

    public Notification[] getNotifications()

  Gets all the notifications registered into the list of notifications.
  Returns:
    An array containing all the notifications registered into the list of notifications.

### getDate

    public java.util.Date getDate(Notification notification)

  Gets a copy of the date of the specified timer notification.
  Parameters:
    `notification` - The timer notification.
  Returns:
    A copy of the date of the specified timer notification or null if the specified timer notification is not in the list of notifications.

### getDate

    public java.util.Date getDate(int index)

  Gets a copy of the date of the timer notification at the specified index.
  Parameters:
    `index` - The index of the timer notification.
  Returns:
    A copy of the date at the specified index in the list of notifications or null if the specified index is invalid.

### getPeriodInMillis

    public java.lang.Long getPeriodInMillis(Notification notification)

  Gets a copy of the period in milliseconds of the specified timer notification.
  Parameters:
    `notification` - The timer notification.
  Returns:
    A copy of the period of the specified timer notification or null if the specified timer notification is not in the list of notifications.

### getPeriodInMillis

    public java.lang.Long getPeriodInMillis(int index)

  Gets a copy of the period in milliseconds of the timer notification at the specified index.
  Parameters:
    `index` - The index of the timer notification.
  Returns:
    A copy of the period at the specified index in the list of notifications or null if the specified index is invalid.

### getNbRepetitions

    public java.lang.Long getNbRepetitions(Notification notification)

  Gets a copy of the remaining number of repetitions of the specified timer notification.
  Parameters:
    `notification` - The timer notification.
  Returns:
    A copy of the remaining number of repetitions of the specified timer notification or null if the specified timer notification is not in the list of notifications.

### getNbRepetitions

    public java.lang.Long getNbRepetitions(int index)

  Gets a copy of the remaining number of repetitions of the timer notification at the specified index.
  Parameters:
    `index` - The index of the timer notification.
  Returns:
    A copy of the remaining number of repetitions at the specified index in the list of notifications or null if the specified index is invalid.

### getNbNotifications

    public int getNbNotifications()

  Gets the number of notifications registered into the list of notifications.
  Returns:
    The number of notifications.

### getSendPastNotifications

    public boolean getSendPastNotifications()

  Gets the flag indicating if the Timer sends past notifications or not.
  Returns:
    The past notifications sending on/off flag value.

### setSendPastNotifications

    public void setSendPastNotifications(boolean value)

  Sets the flag indicating if the Timer sends past notifications or not.
  Parameters:
    `value` - The past notifications sending on/off flag value.

### isActive

    public boolean isActive()

  Tests if the Timer MBean is active. A Timer MBean is marked active when the start method is called. It becomes inactive when the stop method is called.
  Returns:
    True if the Timer MBean is active, false otherwise.

### isEmpty

    public boolean isEmpty()

  Tests if the list of notifications is empty.
  Returns:
    True if the list of notifications is empty, false otherwise.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD