|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.management.NotificationBroadcasterSupport (src)
javax.management.timer.Timer
The timer service.
Field Summary | |
static long |
ONE_DAY
The number of milliseconds in one day. |
static long |
ONE_HOUR
The number of milliseconds in one hour. |
static long |
ONE_MINUTE
The number of milliseconds in one minute. |
static long |
ONE_SECOND
The number of milliseconds in one second. |
static long |
ONE_WEEK
The number of milliseconds in one week. |
Constructor Summary | |
Timer()
|
Method Summary | |
java.lang.Integer |
addNotification(java.lang.String type,
java.lang.String message,
java.lang.Object userData,
java.util.Date date)
Creates a new timer notification for a specific date/time. |
java.lang.Integer |
addNotification(java.lang.String type,
java.lang.String message,
java.lang.Object userData,
java.util.Date date,
long period)
Creates a new timer notification for a specific date/time, with an optional repeat period. |
java.lang.Integer |
addNotification(java.lang.String type,
java.lang.String message,
java.lang.Object userData,
java.util.Date date,
long period,
long occurences)
Creates a new timer notification for a specific date/time, with an optional repeat period and a maximum number of occurences. |
java.lang.Integer |
addNotification(java.lang.String type,
java.lang.String message,
java.lang.Object userData,
java.util.Date date,
long period,
long nbOccurences,
boolean fixedRate)
Creates a new timer notification with the specified type, message and userData and inserts it into the list of notifications with a given date, period and number of occurences. |
java.util.Vector |
getAllNotificationIDs()
Retrieves all timer notifications ids. |
java.util.Date |
getDate(java.lang.Integer id)
Retrieves a copy of the notification date for a passed notification id. |
java.lang.Boolean |
getFixedRate(java.lang.Integer id)
Gets a copy of the flag indicating whether a peridic notification is executed at fixed-delay or at fixed-rate. |
int |
getNbNotifications()
Retrieves the number of registered timer notifications. |
java.lang.Long |
getNbOccurences(java.lang.Integer id)
Retrieves a copy of the maximum notification occurences for a passed notification id. |
java.util.Vector |
getNotificationIDs(java.lang.String type)
Retrieves all timer notifications ids of the passed notification type. |
java.lang.String |
getNotificationMessage(java.lang.Integer id)
Retrieves the notification message for a passed notification id. |
java.lang.String |
getNotificationType(java.lang.Integer id)
Retrieves the notification type for a passed notification id. |
java.lang.Object |
getNotificationUserData(java.lang.Integer id)
Retrieves the notification user data for a passed notification id. |
java.lang.Long |
getPeriod(java.lang.Integer id)
Retrieves a copy of the notification period for a passed notification id. |
boolean |
getSendPastNotifications()
Retrieves the flag indicating whether past notifications are sent. |
boolean |
isActive()
Test whether the timer MBean is active. |
boolean |
isEmpty()
Test whether the timer MBean has any registered notifications. |
void |
postDeregister()
This method is called by the MBeanServer after deregistration takes place. |
void |
postRegister(java.lang.Boolean registrationDone)
This method is called by the MBeanServer after registration takes place or when registration fails. |
void |
preDeregister()
This method is called by the MBeanServer before deregistration takes place. |
ObjectName (src) |
preRegister(MBeanServer (src) server,
ObjectName (src) objectName)
This method is called by the MBeanServer before registration takes place. |
void |
removeAllNotifications()
Removes all notifications from the timer MBean. |
void |
removeNotification(java.lang.Integer id)
Removes a notification from the timer MBean with the specified notification id. |
void |
removeNotifications(java.lang.String type)
Removes all notifications from the timer MBean of the specified notification type. |
void |
setSendPastNotifications(boolean value)
Sets the flag indicating whether past notifications are sent. |
void |
start()
Starts the timer. |
void |
stop()
Stops the timer. |
Methods inherited from class javax.management.NotificationBroadcasterSupport (src) |
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final long ONE_SECOND
public static final long ONE_MINUTE
public static final long ONE_HOUR
public static final long ONE_DAY
public static final long ONE_WEEK
Constructor Detail |
public Timer()
Method Detail |
public java.lang.Integer addNotification(java.lang.String type, java.lang.String message, java.lang.Object userData, java.util.Date date) throws java.lang.IllegalArgumentException
TimerMBean (src)
addNotification
in interface TimerMBean (src)
type
- the notification type.message
- the notification's message string.userData
- the notification's user data.date
- the date/time the notification will occur.
java.lang.IllegalArgumentException
- when the date is before the current
date.public java.lang.Integer addNotification(java.lang.String type, java.lang.String message, java.lang.Object userData, java.util.Date date, long period) throws java.lang.IllegalArgumentException
TimerMBean (src)
If the date and time is before the the current date and time the period is repeatedly added until a date after the current date and time is found.
addNotification
in interface TimerMBean (src)
type
- the notification type.message
- the notification's message string.userData
- the notification's user data.date
- the date/time the notification will occur.period
- the repeat period in milli-seconds. Passing zero means
no repeat.
java.lang.IllegalArgumentException
- when the date is before the current
date or the period is negative.public java.lang.Integer addNotification(java.lang.String type, java.lang.String message, java.lang.Object userData, java.util.Date date, long period, long occurences) throws java.lang.IllegalArgumentException
TimerMBean (src)
If the date and time is before the the current date and time the period is repeatedly added until a date after the current date and time is found. If the number of occurences is exceeded before the current date and time is reached, an IllegalArgumentException is raised.
addNotification
in interface TimerMBean (src)
type
- the notification type.message
- the notification's message string.userData
- the notification's user data.date
- the date/time the notification will occur.period
- the repeat period in milli-seconds. Passing zero means
no repeat.occurences
- the maximum number of repeats. When the period is not
zero and this parameter is zero, it will repeat indefinitely.
java.lang.IllegalArgumentException
- when the date is before the current
date, the period is negative or the number of repeats is
negative.public java.util.Vector getAllNotificationIDs()
TimerMBean (src)
getAllNotificationIDs
in interface TimerMBean (src)
public java.util.Date getDate(java.lang.Integer id)
TimerMBean (src)
getDate
in interface TimerMBean (src)
id
- the notification id.
public int getNbNotifications()
TimerMBean (src)
getNbNotifications
in interface TimerMBean (src)
public java.lang.Long getNbOccurences(java.lang.Integer id)
TimerMBean (src)
getNbOccurences
in interface TimerMBean (src)
id
- the notification id.
public java.lang.Boolean getFixedRate(java.lang.Integer id)
getFixedRate
in interface TimerMBean (src)
id
- The timer notification identifier.
public java.util.Vector getNotificationIDs(java.lang.String type)
TimerMBean (src)
getNotificationIDs
in interface TimerMBean (src)
type
- the notification type.
public java.lang.String getNotificationMessage(java.lang.Integer id)
TimerMBean (src)
getNotificationMessage
in interface TimerMBean (src)
id
- the notification id.
public java.lang.String getNotificationType(java.lang.Integer id)
TimerMBean (src)
getNotificationType
in interface TimerMBean (src)
id
- the notification id.
public java.lang.Object getNotificationUserData(java.lang.Integer id)
TimerMBean (src)
getNotificationUserData
in interface TimerMBean (src)
id
- the notification id.
public java.lang.Long getPeriod(java.lang.Integer id)
TimerMBean (src)
getPeriod
in interface TimerMBean (src)
id
- the notification id.
public boolean getSendPastNotifications()
TimerMBean (src)
getSendPastNotifications
in interface TimerMBean (src)
public boolean isActive()
TimerMBean (src)
isActive
in interface TimerMBean (src)
public boolean isEmpty()
TimerMBean (src)
isEmpty
in interface TimerMBean (src)
public void removeAllNotifications()
TimerMBean (src)
removeAllNotifications
in interface TimerMBean (src)
public void removeNotification(java.lang.Integer id) throws InstanceNotFoundException (src)
TimerMBean (src)
removeNotification
in interface TimerMBean (src)
id
- the notification id.
InstanceNotFoundException (src)
- when there are no notification
registered with the id passed.public void removeNotifications(java.lang.String type) throws InstanceNotFoundException (src)
TimerMBean (src)
removeNotifications
in interface TimerMBean (src)
type
- the notification type.
InstanceNotFoundException (src)
- when there are no notifications of
the type passed.public void setSendPastNotifications(boolean value)
TimerMBean (src)
setSendPastNotifications
in interface TimerMBean (src)
value
- the new value of the flag. true when past notifications
are sent, false otherwise.public void start()
TimerMBean (src)
start
in interface TimerMBean (src)
public void stop()
TimerMBean (src)
stop
in interface TimerMBean (src)
public java.lang.Integer addNotification(java.lang.String type, java.lang.String message, java.lang.Object userData, java.util.Date date, long period, long nbOccurences, boolean fixedRate) throws java.lang.IllegalArgumentException
addNotification
in interface TimerMBean (src)
type
- The timer notification type.message
- The timer notification detailed message.userData
- The timer notification user data object.date
- The date when the notification occurs.period
- The period of the timer notification (in milliseconds).nbOccurences
- The total number the timer notification will be emitted.fixedRate
- If true and if the notification is periodic, the notification is scheduled with a fixed-rate execution scheme. If false and if the notification is periodic, the notification is scheduled with a fixed-delay execution scheme. Ignored if the notification is not periodic.
java.lang.IllegalArgumentException
- The period or the number of occurences is negativepublic ObjectName (src) preRegister(MBeanServer (src) server, ObjectName (src) objectName) throws java.lang.Exception
MBeanRegistration (src)
The MBean can stop the registration by throwing an exception.The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.
preRegister
in interface MBeanRegistration (src)
java.lang.Exception
- for any error, the MBean is not registered.public void postRegister(java.lang.Boolean registrationDone)
MBeanRegistration (src)
postRegister
in interface MBeanRegistration (src)
registrationDone
- the MBeanServer passes true when the
MBean was registered, false otherwise.public void preDeregister() throws java.lang.Exception
MBeanRegistration (src)
The MBean can throw an exception, this will stop the deregistration. The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.
preDeregister
in interface MBeanRegistration (src)
java.lang.Exception
public void postDeregister()
MBeanRegistration (src)
postDeregister
in interface MBeanRegistration (src)
|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |