Top Description Fields Constructors Methods
javax.management

public Class AttributeChangeNotification

extends Notification
Class Inheritance

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

Field Summary

Modifier and TypeField and Description
public static final String
ATTRIBUTE_CHANGE

Notification type which indicates that the observed MBean attribute value has changed.

private String
private String
private Object
private Object
private static final long
Inherited from javax.management.Notification:
source

Constructor Summary

AccessConstructor and Description
public
AttributeChangeNotification(Object
The notification producer, that is, the MBean the attribute belongs to.
source
,
long
The notification sequence number within the source object.
sequenceNumber
,
long
The date at which the notification is being sent.
timeStamp
,
String
A String containing the message of the notification.
msg
,
String
A String giving the name of the attribute.
attributeName
,
String
A String containing the type of the attribute.
attributeType
,
Object
An object representing value of the attribute before the change.
oldValue
,
Object
An object representing value of the attribute after the change.
newValue
)

Constructs an attribute change notification object.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

A String containing the name of the attribute.
getAttributeName
()

Gets the name of the attribute which has changed.

public String

Returns:

A String containing the type of the attribute.
getAttributeType
()

Gets the type of the attribute which has changed.

public Object

Returns:

An Object containing the new value of the attribute.
getNewValue
()

Gets the new value of the attribute which has changed.

public Object

Returns:

An Object containing the old value of the attribute.
getOldValue
()

Gets the old value of the attribute which has changed.

Inherited from javax.management.Notification:
getMessagegetSequenceNumbergetTimeStampgetTypegetUserDatasetSequenceNumbersetSourcesetTimeStampsetUserDatatoString

Field Detail

ATTRIBUTE_CHANGEback to summary
public static final 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.

attributeNameback to summary
private String attributeName
attributeTypeback to summary
private String attributeType
newValueback to summary
private Object newValue
Annotations
@SuppressWarnings:serial
oldValueback to summary
private Object oldValue
Annotations
@SuppressWarnings:serial
serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.management.Notification.serialVersionUID.

Constructor Detail

AttributeChangeNotificationback to summary
public AttributeChangeNotification(Object source, long sequenceNumber, long timeStamp, String msg, String attributeName, String attributeType, Object oldValue, 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:Object

The notification producer, that is, the MBean the attribute belongs to.

sequenceNumber:long

The notification sequence number within the source object.

timeStamp:long

The date at which the notification is being sent.

msg:String

A String containing the message of the notification.

attributeName:String

A String giving the name of the attribute.

attributeType:String

A String containing the type of the attribute.

oldValue:Object

An object representing value of the attribute before the change.

newValue:Object

An object representing value of the attribute after the change.

Method Detail

getAttributeNameback to summary
public String getAttributeName()

Gets the name of the attribute which has changed.

Returns:String

A String containing the name of the attribute.

getAttributeTypeback to summary
public String getAttributeType()

Gets the type of the attribute which has changed.

Returns:String

A String containing the type of the attribute.

getNewValueback to summary
public Object getNewValue()

Gets the new value of the attribute which has changed.

Returns:Object

An Object containing the new value of the attribute.

getOldValueback to summary
public Object getOldValue()

Gets the old value of the attribute which has changed.

Returns:Object

An Object containing the old value of the attribute.