JavaTM Platform
Standard Ed. 6

javax.management
クラス Notification

java.lang.Object
  上位を拡張 java.util.EventObject
      上位を拡張 javax.management.Notification
すべての実装されたインタフェース:
Serializable
直系の既知のサブクラス:
AttributeChangeNotification, JMXConnectionNotification, MBeanServerNotification, MonitorNotification, RelationNotification, TimerNotification

public class Notification
extends EventObject

 

Notification クラスは、MBean が発行する通知を表します。このクラスには、ソース MBean の参照が含まれます。通知が MBean サーバー経由で送信され、この通知の元々のソースが通知発行元の MBean オブジェクトの参照であった場合、MBean サーバーはこれを MBean の ObjectName で置き換えます。リスナーが MBean に直接登録されている場合、これはオブジェクト名か、その MBean の直接参照になります。

 

通知を送信する際は、ソースとして、MBean オブジェクトの参照ではなくオブジェクト名を使用することを強くお勧めします。

 

このクラスの serialVersionUID-7516092053498031989L です。

導入されたバージョン:
1.5
関連項目:
直列化された形式

フィールドの概要
protected  Object source
           このフィールドは、親クラスの EventObject.source フィールドを非表示にすることにより、このフィールドを non-transient にします。
 
コンストラクタの概要
Notification(String type, Object source, long sequenceNumber)
          Notification オブジェクトを作成します。
Notification(String type, Object source, long sequenceNumber, long timeStamp)
          Notification オブジェクトを作成します。
Notification(String type, Object source, long sequenceNumber, long timeStamp, String message)
          Notification オブジェクトを作成します。
Notification(String type, Object source, long sequenceNumber, String message)
          Notification オブジェクトを作成します。
 
メソッドの概要
 String getMessage()
          通知メッセージを取得します。
 long getSequenceNumber()
          通知シーケンス番号を取得します。
 long getTimeStamp()
          通知タイムスタンプを取得します。
 String getType()
          通知型を取得します。
 Object getUserData()
          ユーザーデータを取得します。
 void setSequenceNumber(long sequenceNumber)
          通知シーケンス番号を設定します。
 void setSource(Object source)
          ソースを設定します。
 void setTimeStamp(long timeStamp)
          通知タイムスタンプを設定します。
 void setUserData(Object userData)
          ユーザーデータを設定します。
 String toString()
          この通知の String 表現を返します。
 
クラス java.util.EventObject から継承されたメソッド
getSource
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

source

protected Object source
 

このフィールドは、親クラスの EventObject.source フィールドを非表示にすることにより、このフィールドを non-transient にします。 つまり、このフィールドは、直列化形式の一部になります。

コンストラクタの詳細

Notification

public Notification(String type,
                    Object source,
                    long sequenceNumber)
Notification オブジェクトを作成します。通知 timeStamp には現在時刻が設定されます。

パラメータ:
type - 通知型
source - 通知ソース
sequenceNumber - ソースオブジェクト内の通知シーケンス番号

Notification

public Notification(String type,
                    Object source,
                    long sequenceNumber,
                    String message)
Notification オブジェクトを作成します。通知 timeStamp には現在時刻が設定されます。

パラメータ:
type - 通知型
source - 通知ソース
sequenceNumber - ソースオブジェクト内の通知シーケンス番号
message - 詳細メッセージ

Notification

public Notification(String type,
                    Object source,
                    long sequenceNumber,
                    long timeStamp)
Notification オブジェクトを作成します。

パラメータ:
type - 通知型
source - 通知ソース
sequenceNumber - ソースオブジェクト内の通知シーケンス番号
timeStamp - 通知発行日時

Notification

public Notification(String type,
                    Object source,
                    long sequenceNumber,
                    long timeStamp,
                    String message)
Notification オブジェクトを作成します。

パラメータ:
type - 通知型
source - 通知ソース
sequenceNumber - ソースオブジェクト内の通知シーケンス番号
timeStamp - 通知発行日時
message - 詳細メッセージ
メソッドの詳細

setSource

public void setSource(Object source)
ソースを設定します。

パラメータ:
source - このオブジェクトの新しいソース
関連項目:
EventObject.getSource()

getSequenceNumber

public long getSequenceNumber()
通知シーケンス番号を取得します。

戻り値:
ソースオブジェクト内の通知シーケンス番号通知ソースのコンテキストで、特定の通知を識別するシリアル番号通知モデルでは、通知が送信された順番で受信されることは保証されていない。リスナーは、シーケンス番号を利用して、受信した通知を並べ替える
関連項目:
setSequenceNumber(long)

setSequenceNumber

public void setSequenceNumber(long sequenceNumber)
通知シーケンス番号を設定します。

パラメータ:
sequenceNumber - ソースオブジェクト内の通知シーケンス番号通知ソースのコンテキストで、特定の通知を識別するシリアル番号
関連項目:
getSequenceNumber()

getType

public String getType()
通知型を取得します。

戻り値:
通知型Java プロパティーと同様のドット表記法で表現された文字列。たとえば、network.alarm.router などの通知型がある

getTimeStamp

public long getTimeStamp()
通知タイムスタンプを取得します。

戻り値:
通知タイムスタンプ。
関連項目:
setTimeStamp(long)

setTimeStamp

public void setTimeStamp(long timeStamp)
通知タイムスタンプを設定します。

パラメータ:
timeStamp - 通知タイムスタンプ。通知の生成時刻を示す
関連項目:
getTimeStamp()

getMessage

public String getMessage()
通知メッセージを取得します。

戻り値:
この通知オブジェクトのメッセージ文字列。ユーザーに表示する 通知の説明を含む場合もある

getUserData

public Object getUserData()
ユーザーデータを取得します。

戻り値:
ユーザーデータオブジェクト。通知ソースからコンシューマに伝送される あらゆるデータ用として使用される
関連項目:
setUserData(java.lang.Object)

setUserData

public void setUserData(Object userData)
ユーザーデータを設定します。

パラメータ:
userData - ユーザーデータオブジェクト。通知ソースからコンシューマに伝送される あらゆるデータ用として使用される
関連項目:
getUserData()

toString

public String toString()
この通知の String 表現を返します。

オーバーライド:
クラス EventObject 内の toString
戻り値:
この通知の String 表現

JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。