javax.management
Class Notification

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.util.EventObject sample code for java.util.EventObject definition code for java.util.EventObject 
      extended by javax.management.Notification
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable
Direct Known Subclasses:
AttributeChangeNotification sample code for javax.management.AttributeChangeNotification definition code for javax.management.AttributeChangeNotification , JMXConnectionNotification sample code for javax.management.remote.JMXConnectionNotification definition code for javax.management.remote.JMXConnectionNotification , MBeanServerNotification sample code for javax.management.MBeanServerNotification definition code for javax.management.MBeanServerNotification , MonitorNotification sample code for javax.management.monitor.MonitorNotification definition code for javax.management.monitor.MonitorNotification , RelationNotification sample code for javax.management.relation.RelationNotification definition code for javax.management.relation.RelationNotification , TimerAlarmClockNotification sample code for javax.management.timer.TimerAlarmClockNotification definition code for javax.management.timer.TimerAlarmClockNotification , TimerNotification sample code for javax.management.timer.TimerNotification definition code for javax.management.timer.TimerNotification

public class Notification
extends EventObject sample code for java.util.EventObject definition code for java.util.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.

Since:
1.5
See Also:
Serialized Form

Field Summary
protected  Object sample code for java.lang.Object definition code for java.lang.Object source sample code for javax.management.Notification.source definition code for javax.management.Notification.source
          This field hides the EventObject.source sample code for java.util.EventObject.source definition code for java.util.EventObject.source field in the parent class to make it non-transient and therefore part of the serialized form.
 
Constructor Summary
Notification sample code for javax.management.Notification.Notification(java.lang.String, java.lang.Object, long) definition code for javax.management.Notification.Notification(java.lang.String, java.lang.Object, long) (String sample code for java.lang.String definition code for java.lang.String  type, Object sample code for java.lang.Object definition code for java.lang.Object  source, long sequenceNumber)
          Creates a Notification object.
Notification sample code for javax.management.Notification.Notification(java.lang.String, java.lang.Object, long, long) definition code for javax.management.Notification.Notification(java.lang.String, java.lang.Object, long, long) (String sample code for java.lang.String definition code for java.lang.String  type, Object sample code for java.lang.Object definition code for java.lang.Object  source, long sequenceNumber, long timeStamp)
          Creates a Notification object.
Notification sample code for javax.management.Notification.Notification(java.lang.String, java.lang.Object, long, long, java.lang.String) definition code for javax.management.Notification.Notification(java.lang.String, java.lang.Object, long, long, java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  type, Object sample code for java.lang.Object definition code for java.lang.Object  source, long sequenceNumber, long timeStamp, String sample code for java.lang.String definition code for java.lang.String  message)
          Creates a Notification object.
Notification sample code for javax.management.Notification.Notification(java.lang.String, java.lang.Object, long, java.lang.String) definition code for javax.management.Notification.Notification(java.lang.String, java.lang.Object, long, java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  type, Object sample code for java.lang.Object definition code for java.lang.Object  source, long sequenceNumber, String sample code for java.lang.String definition code for java.lang.String  message)
          Creates a Notification object.
 
Method Summary
 String sample code for java.lang.String definition code for java.lang.String getMessage sample code for javax.management.Notification.getMessage() definition code for javax.management.Notification.getMessage() ()
          Get the notification message.
 long getSequenceNumber sample code for javax.management.Notification.getSequenceNumber() definition code for javax.management.Notification.getSequenceNumber() ()
          Get the notification sequence number.
 long getTimeStamp sample code for javax.management.Notification.getTimeStamp() definition code for javax.management.Notification.getTimeStamp() ()
          Get the notification timestamp.
 String sample code for java.lang.String definition code for java.lang.String getType sample code for javax.management.Notification.getType() definition code for javax.management.Notification.getType() ()
          Get the notification type.
 Object sample code for java.lang.Object definition code for java.lang.Object getUserData sample code for javax.management.Notification.getUserData() definition code for javax.management.Notification.getUserData() ()
          Get the user data.
 void setSequenceNumber sample code for javax.management.Notification.setSequenceNumber(long) definition code for javax.management.Notification.setSequenceNumber(long) (long sequenceNumber)
          Set the notification sequence number.
 void setSource sample code for javax.management.Notification.setSource(java.lang.Object) definition code for javax.management.Notification.setSource(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  source)
          Sets the source.
 void setTimeStamp sample code for javax.management.Notification.setTimeStamp(long) definition code for javax.management.Notification.setTimeStamp(long) (long timeStamp)
          Set the notification timestamp.
 void setUserData sample code for javax.management.Notification.setUserData(java.lang.Object) definition code for javax.management.Notification.setUserData(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  userData)
          Set the user data.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for javax.management.Notification.toString() definition code for javax.management.Notification.toString() ()
          Returns a String representation of this notification.
 
Methods inherited from class java.util.EventObject sample code for java.util.EventObject definition code for java.util.EventObject
getSource sample code for java.util.EventObject.getSource() definition code for java.util.EventObject.getSource()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

source sample code for javax.management.Notification.source

protected Object sample code for java.lang.Object definition code for java.lang.Object  source

This field hides the EventObject.source sample code for java.util.EventObject.source definition code for java.util.EventObject.source field in the parent class to make it non-transient and therefore part of the serialized form.

Constructor Detail

Notification sample code for javax.management.Notification(java.lang.String, java.lang.Object, long) definition code for javax.management.Notification(java.lang.String, java.lang.Object, long)

public Notification(String sample code for java.lang.String definition code for java.lang.String  type,
                    Object sample code for java.lang.Object definition code for java.lang.Object  source,
                    long sequenceNumber)
Creates a Notification object. The notification timeStamp is set to the current date.

Parameters:
type - The notification type.
source - The notification source.
sequenceNumber - The notification sequence number within the source object.

Notification sample code for javax.management.Notification(java.lang.String, java.lang.Object, long, java.lang.String) definition code for javax.management.Notification(java.lang.String, java.lang.Object, long, java.lang.String)

public Notification(String sample code for java.lang.String definition code for java.lang.String  type,
                    Object sample code for java.lang.Object definition code for java.lang.Object  source,
                    long sequenceNumber,
                    String sample code for java.lang.String definition code for java.lang.String  message)
Creates a Notification object. The notification timeStamp is set to the current date.

Parameters:
type - The notification type.
source - The notification source.
sequenceNumber - The notification sequence number within the source object.
message - The detailed message.

Notification sample code for javax.management.Notification(java.lang.String, java.lang.Object, long, long) definition code for javax.management.Notification(java.lang.String, java.lang.Object, long, long)

public Notification(String sample code for java.lang.String definition code for java.lang.String  type,
                    Object sample code for java.lang.Object definition code for java.lang.Object  source,
                    long sequenceNumber,
                    long timeStamp)
Creates a Notification object.

Parameters:
type - The notification type.
source - The notification source.
sequenceNumber - The notification sequence number within the source object.
timeStamp - The notification emission date.

Notification sample code for javax.management.Notification(java.lang.String, java.lang.Object, long, long, java.lang.String) definition code for javax.management.Notification(java.lang.String, java.lang.Object, long, long, java.lang.String)

public Notification(String sample code for java.lang.String definition code for java.lang.String  type,
                    Object sample code for java.lang.Object definition code for java.lang.Object  source,
                    long sequenceNumber,
                    long timeStamp,
                    String sample code for java.lang.String definition code for java.lang.String  message)
Creates a Notification object.

Parameters:
type - The notification type.
source - The notification source.
sequenceNumber - The notification sequence number within the source object.
timeStamp - The notification emission date.
message - The detailed message.
Method Detail

setSource sample code for javax.management.Notification.setSource(java.lang.Object) definition code for javax.management.Notification.setSource(java.lang.Object)

public void setSource(Object sample code for java.lang.Object definition code for java.lang.Object  source)
Sets the source.

Parameters:
source - the new source for this object.
See Also:
EventObject.getSource() sample code for java.util.EventObject.getSource() definition code for java.util.EventObject.getSource()

getSequenceNumber sample code for javax.management.Notification.getSequenceNumber() definition code for javax.management.Notification.getSequenceNumber()

public long getSequenceNumber()
Get the notification sequence number.

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.
See Also:
setSequenceNumber(long) sample code for javax.management.Notification.setSequenceNumber(long) definition code for javax.management.Notification.setSequenceNumber(long)

setSequenceNumber sample code for javax.management.Notification.setSequenceNumber(long) definition code for javax.management.Notification.setSequenceNumber(long)

public void setSequenceNumber(long sequenceNumber)
Set the notification sequence number.

Parameters:
sequenceNumber - 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.
See Also:
getSequenceNumber() sample code for javax.management.Notification.getSequenceNumber() definition code for javax.management.Notification.getSequenceNumber()

getType sample code for javax.management.Notification.getType() definition code for javax.management.Notification.getType()

public String sample code for java.lang.String definition code for java.lang.String  getType()
Get the notification type.

Returns:
The notification type. It's a string expressed in a dot notation similar to Java properties. An example of a notification type is network.alarm.router .

getTimeStamp sample code for javax.management.Notification.getTimeStamp() definition code for javax.management.Notification.getTimeStamp()

public long getTimeStamp()
Get the notification timestamp.

Returns:
The notification timestamp.
See Also:
setTimeStamp(long) sample code for javax.management.Notification.setTimeStamp(long) definition code for javax.management.Notification.setTimeStamp(long)

setTimeStamp sample code for javax.management.Notification.setTimeStamp(long) definition code for javax.management.Notification.setTimeStamp(long)

public void setTimeStamp(long timeStamp)
Set the notification timestamp.

Parameters:
timeStamp - The notification timestamp. It indicates when the notification was generated.
See Also:
getTimeStamp() sample code for javax.management.Notification.getTimeStamp() definition code for javax.management.Notification.getTimeStamp()

getMessage sample code for javax.management.Notification.getMessage() definition code for javax.management.Notification.getMessage()

public String sample code for java.lang.String definition code for java.lang.String  getMessage()
Get the notification message.

Returns:
The message string of this notification object. It contains in a string, which could be the explanation of the notification for displaying to a user

getUserData sample code for javax.management.Notification.getUserData() definition code for javax.management.Notification.getUserData()

public Object sample code for java.lang.Object definition code for java.lang.Object  getUserData()
Get the user data.

Returns:
The user data object. It is used for whatever data the notification source wishes to communicate to its consumers.
See Also:
setUserData(java.lang.Object) sample code for javax.management.Notification.setUserData(java.lang.Object) definition code for javax.management.Notification.setUserData(java.lang.Object)

setUserData sample code for javax.management.Notification.setUserData(java.lang.Object) definition code for javax.management.Notification.setUserData(java.lang.Object)

public void setUserData(Object sample code for java.lang.Object definition code for java.lang.Object  userData)
Set the user data.

Parameters:
userData - The user data object. It is used for whatever data the notification source wishes to communicate to its consumers.
See Also:
getUserData() sample code for javax.management.Notification.getUserData() definition code for javax.management.Notification.getUserData()

toString sample code for javax.management.Notification.toString() definition code for javax.management.Notification.toString()

public String sample code for java.lang.String definition code for java.lang.String  toString()
Returns a String representation of this notification.

Overrides:
toString sample code for java.util.EventObject.toString() definition code for java.util.EventObject.toString() in class EventObject sample code for java.util.EventObject definition code for java.util.EventObject
Returns:
A String representation of this notification.