javax.management
public class Notification extends EventObject
A notification message that may be emitted by a bean. Notifications have both a message and a type, so individual notifications can be grouped by type. They also incorporate sequencing, so that the recipient can order the delivered messages correctly (there is no guarantee that they will be delivered in order).
Notifications also include a reference to the source of the notification. The source bean is represented either by an {@link ObjectName} or by a direct reference to the bean. The former is preferable, and notifications emitted via a {@link MBeanServer} will automatically have the source transformed into an {@link ObjectName}.
Since: 1.5
Field Summary | |
---|---|
protected Object | source
The source of the notification. |
Constructor Summary | |
---|---|
Notification(String type, Object source, long sequenceNumber)
Creates a new {@link Notification} object with the specified type,
source and sequence number. | |
Notification(String type, Object source, long sequenceNumber, long timeStamp)
Creates a new {@link Notification} object with the specified type,
source, sequence number and timestamp.
| |
Notification(String type, Object source, long sequenceNumber, long timeStamp, String message)
Creates a new {@link Notification} object with the specified type,
source, sequence number, timestamp and message.
| |
Notification(String type, Object source, long sequenceNumber, String message)
Creates a new {@link Notification} object with the specified type,
source, sequence number and message. |
Method Summary | |
---|---|
String | getMessage()
Returns the message contained in this notification. |
long | getSequenceNumber()
Returns the sequence number of this notification. |
long | getTimeStamp()
Returns the date and time at which this notification was
emitted.
|
String | getType()
Returns the type of this notification. |
Object | getUserData()
Returns the additional user data associated with the notification.
|
void | setSequenceNumber(long sequenceNumber)
Sets the sequence number to the value specified.
|
void | setSource(Object source)
Sets the source of this notification to the value
specified.
|
void | setTimeStamp(long timeStamp)
Sets the date and time at which this notification
was emitted.
|
void | setUserData(Object userData)
Sets the additional user data associated with the notification
to the specified value. |
String | toString()
A textual representation of the notification.
|
source
variable in {@link java.util.EventObject}
with a non-transient version.
Serial: the notification source.
Parameters: type the type of the notification. source the source of the notification. sequenceNumber the sequence number of the notifcation.
Parameters: type the type of the notification. source the source of the notification. sequenceNumber the sequence number of the notifcation. timeStamp the time the notification was emitted.
Parameters: type the type of the notification. source the source of the notification. sequenceNumber the sequence number of the notifcation. timeStamp the time the notification was emitted. message the message contained in the notification.
Parameters: type the type of the notification. source the source of the notification. sequenceNumber the sequence number of the notifcation. message the message contained in the notification.
userData
field.
Returns: the notification message.
See Also: getUserData setUserData
Returns: the sequence number.
See Also: Notification
Returns: the notification timestamp.
See Also: Notification
Returns: the type of the notification.
Returns: the user data associated with the notification.
See Also: setUserData
Parameters: sequenceNumber the new sequence number.
See Also: getSequenceNumber
Parameters: source the new source of the notification.
See Also: java.util.EventSource#getSource()
Parameters: timeStamp the new time stamp of the notification.
See Also: getTimeStamp
Parameters: userData the new user data associated with the notification.
See Also: getUserData
Returns: the notification in {@link java.lang.String} form.