The Notification class represents a notification emitted by an MBean. It contains a reference to the source MBean: if the notification has been forwarded through the MBean server, and the original source of the notification was a reference to the emitting MBean object, then the MBean server replaces it by the MBean's ObjectName. If the listener has registered directly with the MBean, this is either the object name or a direct reference to the MBean.
It is strongly recommended that notification senders use the object name rather than a reference to the MBean object as the source.
The serialVersionUID of this class is -7516092053498031989L
.
Modifier and Type | Field and Description |
---|---|
private static boolean | |
private String | |
private static final ObjectStreamField[] | |
private static final long | |
private static final ObjectStreamField[] | |
private static final long | |
private long | |
private static final ObjectStreamField[] | |
private static final long | |
protected Object | source
Hides java. This field hides the |
private long | |
private String | |
private Object |
Access | Constructor and Description |
---|---|
public | Notification(String
The notification type. type, Object The notification source. source, long The notification sequence number within the source object. sequenceNumber)Creates a Notification object. |
public | Notification(String
The notification type. type, Object The notification source. source, long The notification sequence number within the source object. sequenceNumber, String The detailed message. message)Creates a Notification object. |
public | Notification(String
The notification type. type, Object The notification source. source, long The notification sequence number within the source object. sequenceNumber, long The notification emission date. timeStamp)Creates a Notification object. |
public | Notification(String
The notification type. type, Object The notification source. source, long The notification sequence number within the source object. sequenceNumber, long The notification emission date. timeStamp, String The detailed message. message)Creates a Notification object. |
Modifier and Type | Method and Description |
---|---|
public String | |
public long | Returns: The notification sequence number within the source object. It's a serial number identifying a particular instance of notification in the context of the notification source. The notification model does not assume that notifications will be received in the same order that they are sent. The sequence number helps listeners to sort received notifications.Get the notification sequence number. |
public long | |
public String | Returns: The notification type. It's a string expressed in a dot notation similar to Java properties. It is recommended that the notification type should follow the reverse-domain-name convention used by Java package names. An example of a notification type is com.example.alarm.router.Get the notification type. |
public Object | Returns: The user data object. It is used for whatever data the notification source wishes to communicate to its consumers.Get the user data. |
private void | |
public void | setSequenceNumber(long
The notification sequence number within the source object. It is
a serial number identifying a particular instance of notification in the
context of the notification source. sequenceNumber)Set the notification sequence number. |
public void | |
public void | setTimeStamp(long
The notification timestamp. It indicates when the notification was generated. timeStamp)Set the notification timestamp. |
public void | setUserData(Object
The user data object. It is used for whatever data
the notification source wishes to communicate to its consumers. userData)Set the user data. |
public String | Returns: A String representation of this notification.Overrides java. |
private void |
compat | back to summary |
---|---|
private static boolean compat |
message | back to summary |
---|---|
private String message |
newSerialPersistentFields | back to summary |
---|---|
private static final ObjectStreamField[] newSerialPersistentFields |
newSerialVersionUID | back to summary |
---|---|
private static final long newSerialVersionUID |
oldSerialPersistentFields | back to summary |
---|---|
private static final ObjectStreamField[] oldSerialPersistentFields |
oldSerialVersionUID | back to summary |
---|---|
private static final long oldSerialVersionUID |
sequenceNumber | back to summary |
---|---|
private long sequenceNumber |
serialPersistentFields | back to summary |
---|---|
private static final ObjectStreamField[] serialPersistentFields
|
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID |
source | back to summary |
---|---|
protected Object source Hides java. This field hides the |
timeStamp | back to summary |
---|---|
private long timeStamp |
type | back to summary |
---|---|
private String type |
userData | back to summary |
---|---|
private Object userData |
Notification | back to summary |
---|---|
public Notification(String type, Object source, long sequenceNumber) Creates a Notification object. The notification timeStamp is set to the current date. |
Notification | back to summary |
---|---|
public Notification(String type, Object source, long sequenceNumber, String message) Creates a Notification object. The notification timeStamp is set to the current date. |
Notification | back to summary |
---|---|
public Notification(String type, Object source, long sequenceNumber, long timeStamp) Creates a Notification object. |
Notification | back to summary |
---|---|
public Notification(String type, Object source, long sequenceNumber, long timeStamp, String message) Creates a Notification object. |
getMessage | back to summary |
---|---|
public String getMessage() Get the notification message.
|
getSequenceNumber | back to summary |
---|---|
public long getSequenceNumber() Get the notification sequence number.
|
getTimeStamp | back to summary |
---|---|
public long getTimeStamp() Get the notification timestamp.
|
getType | back to summary |
---|---|
public String getType() Get the notification type.
|
getUserData | back to summary |
---|---|
public Object getUserData() Get the user data.
|
readObject | back to summary |
---|---|
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException Deserializes a |
setSequenceNumber | back to summary |
---|---|
public void setSequenceNumber(long sequenceNumber) Set the notification sequence number.
|
setSource | back to summary |
---|---|
public void setSource(Object source) Sets the source.
|
setTimeStamp | back to summary |
---|---|
public void setTimeStamp(long timeStamp) Set the notification timestamp.
|
setUserData | back to summary |
---|---|
public void setUserData(Object userData) Set the user data.
|
toString | back to summary |
---|---|
public String toString() Overrides java. Returns a String representation of this notification. |
writeObject | back to summary |
---|---|
private void writeObject(ObjectOutputStream out) throws IOException Serializes a |