javax.management
Class AttributeChangeNotification

java.lang.Object
  extended by java.util.EventObject
      extended by javax.management.Notification
          extended by javax.management.AttributeChangeNotification
All Implemented Interfaces:
Serializable

public class AttributeChangeNotification
extends Notification

Defines the notification used to let listeners know of an attribute change. The bean itself is responsible for creating and transmitting the notification when the attribute changes, by implementing NotificationBroadcaster. For example, if a bean increments the integer, count, it should send a notification with the attributeName, "count", the attributeType, "Integer" and the old and new values of the attribute.

Since:
1.5
See Also:
Serialized Form

Field Summary
static String ATTRIBUTE_CHANGE
          The attribute type for attribute change notifications.
 
Fields inherited from class javax.management.Notification
source
 
Constructor Summary
AttributeChangeNotification(Object source, long sequenceNumber, long timeStamp, String msg, String name, String type, Object oldVal, Object newVal)
          Constructs a new AttributeChangeNotification with the specified source, sequence number, timestamp, message, and the attribute name, type, old value and new value.
 
Method Summary
 String getAttributeName()
          Returns the name of the attribute that changed.
 String getAttributeType()
          Returns the type of the attribute that changed.
 Object getNewValue()
          Returns the new value of the attribute.
 Object getOldValue()
          Returns the old value of the attribute.
 
Methods inherited from class javax.management.Notification
getMessage, getSequenceNumber, getTimeStamp, getType, getUserData, setSequenceNumber, setSource, setTimeStamp, setUserData, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTRIBUTE_CHANGE

public static final String ATTRIBUTE_CHANGE
The attribute type for attribute change notifications.

See Also:
Constant Field Values
Constructor Detail

AttributeChangeNotification

public AttributeChangeNotification(Object source,
                                   long sequenceNumber,
                                   long timeStamp,
                                   String msg,
                                   String name,
                                   String type,
                                   Object oldVal,
                                   Object newVal)
Constructs a new AttributeChangeNotification with the specified source, sequence number, timestamp, message, and the attribute name, type, old value and new value.

Parameters:
source - the producer of the notification, which is usually the bean that changed the attribute.
sequenceNumber - the sequence number of the notification.
timeStamp - the date and time of the notification.
msg - the message content of the notification.
name - the name of the attribute.
type - the type of the attribute.
oldVal - the old value of the attribute.
newVal - the new value of the attribute.
Method Detail

getAttributeName

public String getAttributeName()
Returns the name of the attribute that changed.

Returns:
the name of the attribute.

getAttributeType

public String getAttributeType()
Returns the type of the attribute that changed.

Returns:
the type of the attribute.

getOldValue

public Object getOldValue()
Returns the old value of the attribute.

Returns:
the old value.

getNewValue

public Object getNewValue()
Returns the new value of the attribute.

Returns:
the new value.