javax.management

Class AttributeChangeNotification

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 {@link 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

Field Summary
static StringATTRIBUTE_CHANGE
The attribute type for attribute change notifications.
Constructor Summary
AttributeChangeNotification(Object source, long sequenceNumber, long timeStamp, String msg, String name, String type, Object oldVal, Object newVal)
Constructs a new {@link AttributeChangeNotification} with the specified source, sequence number, timestamp, message, and the attribute name, type, old value and new value.
Method Summary
StringgetAttributeName()
Returns the name of the attribute that changed.
StringgetAttributeType()
Returns the type of the attribute that changed.
ObjectgetNewValue()
Returns the new value of the attribute.
ObjectgetOldValue()
Returns the old value of the attribute.

Field Detail

ATTRIBUTE_CHANGE

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

Constructor Detail

AttributeChangeNotification

public AttributeChangeNotification(Object source, long sequenceNumber, long timeStamp, String msg, String name, String type, Object oldVal, Object newVal)
Constructs a new {@link 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.

getNewValue

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

Returns: the new value.

getOldValue

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

Returns: the old value.