javax.management
Class AttributeChangeNotification

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 sample code for javax.management.Notification definition code for javax.management.Notification 
          extended by javax.management.AttributeChangeNotification
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public class AttributeChangeNotification
extends Notification sample code for javax.management.Notification definition code for javax.management.Notification

Provides definitions of the attribute change notifications sent by MBeans.

It's up to the MBean owning the attribute of interest to create and send attribute change notifications when the attribute change occurs. So the NotificationBroadcaster interface has to be implemented by any MBean for which an attribute change is of interest.

Example: If an MBean called myMbean needs to notify registered listeners when its attribute:

String myString
is modified, myMbean creates and emits the following notification:
new AttributeChangeNotification(myMbean, sequenceNumber, timeStamp, msg, "myString", "String", oldValue, newValue);

Since:
1.5
See Also:
Serialized Form

Field Summary
static String sample code for java.lang.String definition code for java.lang.String ATTRIBUTE_CHANGE sample code for javax.management.AttributeChangeNotification.ATTRIBUTE_CHANGE definition code for javax.management.AttributeChangeNotification.ATTRIBUTE_CHANGE
          Notification type which indicates that the observed MBean attribute value has changed.
 
Fields inherited from class javax.management.Notification sample code for javax.management.Notification definition code for javax.management.Notification
source sample code for javax.management.Notification.source definition code for javax.management.Notification.source
 
Constructor Summary
AttributeChangeNotification sample code for javax.management.AttributeChangeNotification.AttributeChangeNotification(java.lang.Object, long, long, java.lang.String, java.lang.String, java.lang.String, java.lang.Object, java.lang.Object) definition code for javax.management.AttributeChangeNotification.AttributeChangeNotification(java.lang.Object, long, long, java.lang.String, java.lang.String, java.lang.String, java.lang.Object, java.lang.Object) (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  msg, String sample code for java.lang.String definition code for java.lang.String  attributeName, String sample code for java.lang.String definition code for java.lang.String  attributeType, Object sample code for java.lang.Object definition code for java.lang.Object  oldValue, Object sample code for java.lang.Object definition code for java.lang.Object  newValue)
          Constructs an attribute change notification object.
 
Method Summary
 String sample code for java.lang.String definition code for java.lang.String getAttributeName sample code for javax.management.AttributeChangeNotification.getAttributeName() definition code for javax.management.AttributeChangeNotification.getAttributeName() ()
          Gets the name of the attribute which has changed.
 String sample code for java.lang.String definition code for java.lang.String getAttributeType sample code for javax.management.AttributeChangeNotification.getAttributeType() definition code for javax.management.AttributeChangeNotification.getAttributeType() ()
          Gets the type of the attribute which has changed.
 Object sample code for java.lang.Object definition code for java.lang.Object getNewValue sample code for javax.management.AttributeChangeNotification.getNewValue() definition code for javax.management.AttributeChangeNotification.getNewValue() ()
          Gets the new value of the attribute which has changed.
 Object sample code for java.lang.Object definition code for java.lang.Object getOldValue sample code for javax.management.AttributeChangeNotification.getOldValue() definition code for javax.management.AttributeChangeNotification.getOldValue() ()
          Gets the old value of the attribute which has changed.
 
Methods inherited from class javax.management.Notification sample code for javax.management.Notification definition code for javax.management.Notification
getMessage sample code for javax.management.Notification.getMessage() definition code for javax.management.Notification.getMessage() , getSequenceNumber sample code for javax.management.Notification.getSequenceNumber() definition code for javax.management.Notification.getSequenceNumber() , getTimeStamp sample code for javax.management.Notification.getTimeStamp() definition code for javax.management.Notification.getTimeStamp() , getType sample code for javax.management.Notification.getType() definition code for javax.management.Notification.getType() , getUserData sample code for javax.management.Notification.getUserData() definition code for javax.management.Notification.getUserData() , setSequenceNumber sample code for javax.management.Notification.setSequenceNumber(long) definition code for javax.management.Notification.setSequenceNumber(long) , setSource sample code for javax.management.Notification.setSource(java.lang.Object) definition code for javax.management.Notification.setSource(java.lang.Object) , setTimeStamp sample code for javax.management.Notification.setTimeStamp(long) definition code for javax.management.Notification.setTimeStamp(long) , setUserData sample code for javax.management.Notification.setUserData(java.lang.Object) definition code for javax.management.Notification.setUserData(java.lang.Object) , toString sample code for javax.management.Notification.toString() definition code for javax.management.Notification.toString()
 
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

ATTRIBUTE_CHANGE sample code for javax.management.AttributeChangeNotification.ATTRIBUTE_CHANGE

public static final String sample code for java.lang.String definition code for java.lang.String  ATTRIBUTE_CHANGE
Notification type which indicates that the observed MBean attribute value has changed.
The value of this type string is jmx.attribute.change.

See Also:
Constant Field Values
Constructor Detail

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

public AttributeChangeNotification(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  msg,
                                   String sample code for java.lang.String definition code for java.lang.String  attributeName,
                                   String sample code for java.lang.String definition code for java.lang.String  attributeType,
                                   Object sample code for java.lang.Object definition code for java.lang.Object  oldValue,
                                   Object sample code for java.lang.Object definition code for java.lang.Object  newValue)
Constructs an attribute change notification object. In addition to the information common to all notification, the caller must supply the name and type of the attribute, as well as its old and new values.

Parameters:
source - The notification producer, that is, the MBean the attribute belongs to.
sequenceNumber - The notification sequence number within the source object.
timeStamp - The date at which the notification is being sent.
msg - A String containing the message of the notification.
attributeName - A String giving the name of the attribute.
attributeType - A String containing the type of the attribute.
oldValue - An object representing value of the attribute before the change.
newValue - An object representing value of the attribute after the change.
Method Detail

getAttributeName sample code for javax.management.AttributeChangeNotification.getAttributeName() definition code for javax.management.AttributeChangeNotification.getAttributeName()

public String sample code for java.lang.String definition code for java.lang.String  getAttributeName()
Gets the name of the attribute which has changed.

Returns:
A String containing the name of the attribute.

getAttributeType sample code for javax.management.AttributeChangeNotification.getAttributeType() definition code for javax.management.AttributeChangeNotification.getAttributeType()

public String sample code for java.lang.String definition code for java.lang.String  getAttributeType()
Gets the type of the attribute which has changed.

Returns:
A String containing the type of the attribute.

getOldValue sample code for javax.management.AttributeChangeNotification.getOldValue() definition code for javax.management.AttributeChangeNotification.getOldValue()

public Object sample code for java.lang.Object definition code for java.lang.Object  getOldValue()
Gets the old value of the attribute which has changed.

Returns:
An Object containing the old value of the attribute.

getNewValue sample code for javax.management.AttributeChangeNotification.getNewValue() definition code for javax.management.AttributeChangeNotification.getNewValue()

public Object sample code for java.lang.Object definition code for java.lang.Object  getNewValue()
Gets the new value of the attribute which has changed.

Returns:
An Object containing the new value of the attribute.