public class AttributeChangeNotification extends Notification
属性が変更されたとき属性変更通知を作成し、送信するのは、その属性を所有する MBean です。したがって、属性が変更される MBean は、NotificationBroadcaster インタフェースを実装する必要があります。
例:MBean によって呼び出される myMbean は、次の属性が変更されたとき、登録済みのリスナーに通知を送る必要があります。
String myString
myMbean によって作成され、送信される通知の内容は次のとおりです。
new AttributeChangeNotification(myMbean, sequenceNumber, timeStamp, msg, "myString", "String", oldValue, newValue); | 修飾子と型 | フィールドと説明 |
|---|---|
static String |
ATTRIBUTE_CHANGE
監視対象の MBean 属性値が変更されたことを示す通知型です。
|
source| コンストラクタと説明 |
|---|
AttributeChangeNotification(Object source, long sequenceNumber, long timeStamp, String msg, String attributeName, String attributeType, Object oldValue, Object newValue)
属性変更通知オブジェクトを構築します。
|
| 修飾子と型 | メソッドと説明 |
|---|---|
String |
getAttributeName()
変更された属性の名前を取得します。
|
String |
getAttributeType()
変更された属性の型を取得します。
|
Object |
getNewValue()
変更された属性の新しい値を取得します。
|
Object |
getOldValue()
変更された属性の古い値を取得します。
|
getMessage, getSequenceNumber, getTimeStamp, getType, getUserData, setSequenceNumber, setSource, setTimeStamp, setUserData, toStringgetSourcepublic AttributeChangeNotification(Object source, long sequenceNumber, long timeStamp, String msg, String attributeName, String attributeType, Object oldValue, Object newValue)
source - 通知の作成元。その属性を所有する MBean。sequenceNumber - ソースオブジェクト内の通知シーケンス番号。timeStamp - 通知が送信される日付。msg - 通知のメッセージを含む String。attributeName - 属性の名前を指定する String。attributeType - 属性の型を含む String。oldValue - 属性の変更前の値を示すオブジェクト。newValue - 属性の変更後の値を示すオブジェクト。public String getAttributeName()
public String getAttributeType()
public Object getOldValue()
public Object getNewValue()
バグまたは機能を送信
詳細な API リファレンスおよび開発者ドキュメントについては、Java SE のドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.