Notification (Java SE 16 & JDK 16) (original) (raw)

All Implemented Interfaces:

[Serializable](../../../java.base/java/io/Serializable.html "interface in java.io")

Direct Known Subclasses:

[AttributeChangeNotification](AttributeChangeNotification.html "class in javax.management"), [JMXConnectionNotification](remote/JMXConnectionNotification.html "class in javax.management.remote"), [MBeanServerNotification](MBeanServerNotification.html "class in javax.management"), [MonitorNotification](monitor/MonitorNotification.html "class in javax.management.monitor"), [RelationNotification](relation/RelationNotification.html "class in javax.management.relation"), [TimerNotification](timer/TimerNotification.html "class in javax.management.timer")


public class Notification extends EventObject

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.

Since:

1.5

See Also:

Serialized Form

Fields
This field hides the EventObject.source field in the parent class to make it non-transient and therefore part of the serialized form.

Constructors
Creates a Notification object.
[Notification](#%3Cinit%3E%28java.lang.String,java.lang.Object,long,long%29)​([String](../../../java.base/java/lang/String.html "class in java.lang") type,[Object](../../../java.base/java/lang/Object.html "class in java.lang") source, long sequenceNumber, long timeStamp)
Creates a Notification object.
[Notification](#%3Cinit%3E%28java.lang.String,java.lang.Object,long,long,java.lang.String%29)​([String](../../../java.base/java/lang/String.html "class in java.lang") type,[Object](../../../java.base/java/lang/Object.html "class in java.lang") source, long sequenceNumber, long timeStamp,[String](../../../java.base/java/lang/String.html "class in java.lang") message)
Creates a Notification object.
Creates a Notification object.

Get the notification message.
long
Get the notification sequence number.
long
Get the notification timestamp.
[getType](#getType%28%29)()
Get the notification type.
void
[setSequenceNumber](#setSequenceNumber%28long%29)​(long sequenceNumber)
Set the notification sequence number.
void
void
[setTimeStamp](#setTimeStamp%28long%29)​(long timeStamp)
Set the notification timestamp.
void
[toString](#toString%28%29)()
Returns a String representation of this notification.