JavaTM Platform
Standard Ed. 6

javax.management.modelmbean
クラス RequiredModelMBean

java.lang.Object
  上位を拡張 javax.management.modelmbean.RequiredModelMBean
すべての実装されたインタフェース:
DynamicMBean, MBeanRegistration, ModelMBean, ModelMBeanNotificationBroadcaster, NotificationBroadcaster, NotificationEmitter, PersistentMBean

public class RequiredModelMBean
extends Object
implements ModelMBean, MBeanRegistration, NotificationEmitter

このクラスは、ModelMBean の実装です。すべての JMX エージェントに適切な ModelMBean の実装が付属している必要があります。また、クラス名は必ず RequiredModelMBean とします。

管理対象になる Java リソースは、MBeanServer の createMBean メソッドを使って、RequiredModelMBean をインスタンス化します。次に、RequiredModelMBean インスタンスの MBeanInfo および Descriptor を設定します。ModelMBean の ModelMBeanInfo で公開された属性とオペレーションには、MBean、コネクタ、アダプタからアクセスできます。Descriptor を使って、管理対象アプリケーション内の値とメソッドを定義し、ModelMBean の属性およびオペレーションにマップすることができます。このマッピングは、XML 形式のファイル内、または実行時にプログラムを使って動的に定義できます。

MBeanServer 内でインスタンス化される各 RequiredModelMBean が管理対象になります。
これらの属性およびオペレーションには、MBeanServer に接続されたコネクタまたはアダプタ経由でリモートアクセスできます。

JMX 準拠の MBean でない Java オブジェクトは、MBeanServer に登録できません。RequiredModelMBean をインスタンス化することで、リソースは MBean が有効であることを保証されます。 すべての public メソッドで、MBeanException および RuntimeOperationsException がスローされる必要があります。これにより、分散型通信 (RMI、EJB など) からの例外のラップが可能になります。

導入されたバージョン:
1.5

コンストラクタの概要
RequiredModelMBean()
          空の ModelMBeanInfo で RequiredModelMBean を構築します。
RequiredModelMBean(ModelMBeanInfo mbi)
          渡された ModelMBeanInfo を使って RequiredModelMBean オブジェクトを構築します。
 
メソッドの概要
 void addAttributeChangeNotificationListener(NotificationListener inlistener, String inAttributeName, Object inhandback)
          NotificationListener インタフェースを実装するオブジェクトをリスナーとして登録します。
 void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
          NotificationListener インタフェースを実装するオブジェクトをリスナーとして登録します。
 Object getAttribute(String attrName)
          この ModelMBean に定義された特定の属性の値を返します。
 AttributeList getAttributes(String[] attrNames)
          ModelMBean 内の複数の属性の値を返します。
protected  ClassLoaderRepository getClassLoaderRepository()
          クラスのロードに使用されたクラスローダーリポジトリを返します。
 MBeanInfo getMBeanInfo()
          この RequiredModelMBean が管理用として公開する属性、オペレーション、コンストラクタ、および通知を返します。
 MBeanNotificationInfo[] getNotificationInfo()
          RequiredModelMBean によって生成された Notification の配列を返します。
 Object invoke(String opName, Object[] opArgs, String[] sig)
          RequiredModelMBean からメソッドを呼び出し、その実行結果を返します。
 void load()
          この MBean インスタンスを持続ストア内の MBean 用データでインスタンス化します。
 void postDeregister()
          MBean サーバーから登録解除したあと、MBean が必要なオペレーションを実行できるようにします。
 void postRegister(Boolean registrationDone)
          MBean サーバーへの登録が成功または失敗したあと、MBean が必要なオペレーションを実行できるようにします。
 void preDeregister()
          MBean サーバーから登録解除する前に、MBean が必要なオペレーションを実行できるようにします。
 ObjectName preRegister(MBeanServer server, ObjectName name)
          MBean サーバーに登録する前に、MBean に必要なオペレーションを実行させることができます。
 void removeAttributeChangeNotificationListener(NotificationListener inlistener, String inAttributeName)
          RequiredModelMBean から attributeChangeNotification のリスナーを削除します。
 void removeNotificationListener(NotificationListener listener)
          RequiredModelMBean から Notification のリスナーを削除します。
 void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
          この MBean からリスナーを削除します。
 void sendAttributeChangeNotification(Attribute inOldVal, Attribute inNewVal)
          ModelMBean 上の登録済み AttributeChangeNotification リスナーに、属性の古い値と新しい値を含む attributeChangeNotification を送信します。
 void sendAttributeChangeNotification(AttributeChangeNotification ntfyObj)
          ModelMBean 上の登録済み attributeChangeNotification リスナーに渡される attributeChangeNotification を送信します。
 void sendNotification(Notification ntfyObj)
          ModelMBean 上の登録済み Notification リスナーに、jmx.modelmbean.generic 通知として渡される Notification を送信します。
 void sendNotification(String ntfyText)
          ModelMBean 上の登録済み Notification リスナーに渡されるテキスト文字列を含む Notification を送信します。
 void setAttribute(Attribute attribute)
          指定の ModelMBean の特定の属性の値を設定します。
 AttributeList setAttributes(AttributeList attributes)
          この ModelMBean の属性の配列の値を設定します。
 void setManagedResource(Object mr, String mr_type)
          この ModelMBean 管理インタフェース内のすべてのメソッド (MBeanInfo と Descriptor) の実行対象となる、オブジェクトのインスタンスハンドルを設定します。
 void setModelMBeanInfo(ModelMBeanInfo mbi)
          ModelMBeanInfo を使って ModelMBean オブジェクトを初期化します。
 void store()
          この MBean インスタンスの現在の状態を取り込み、持続ストアに書き出します。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

RequiredModelMBean

public RequiredModelMBean()
                   throws MBeanException,
                          RuntimeOperationsException
空の ModelMBeanInfo で RequiredModelMBean を構築します。

RequiredModelMBean の MBeanInfo および Descriptor は、setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) メソッドでカスタマイズできます。RequiredModelMBean の MBeanInfo および Descriptor のカスタマイズ後、RequiredModelMBean を MBeanServer に登録することができます。

例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - オブジェクトの構築時に RuntimeException をラップする

RequiredModelMBean

public RequiredModelMBean(ModelMBeanInfo mbi)
                   throws MBeanException,
                          RuntimeOperationsException
渡された ModelMBeanInfo を使って RequiredModelMBean オブジェクトを構築します。RequiredModelMBean がまだ MBeanServer に登録されていない場合に限り、setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) メソッドを使って RequiredModelMBean の MBeanInfo および Descriptor をカスタマイズできます。RequiredModelMBean の MBeanInfo および Descriptor のカスタマイズ後、RequiredModelMBean を MBeanServer に登録することができます。

パラメータ:
mbi - RequiredModelMBean によって使用される ModelMBeanInfo オブジェクト。指定された ModelMBeanInfo が、 setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) で指定されたように複製され、変更される
例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - {link java.lang.IllegalArgumentException} を ラップする。 パラメータに渡される MBeanInfo が null の場合
メソッドの詳細

setModelMBeanInfo

public void setModelMBeanInfo(ModelMBeanInfo mbi)
                       throws MBeanException,
                              RuntimeOperationsException
ModelMBeanInfo を使って ModelMBean オブジェクトを初期化します。このメソッドを使用すると、ModelMBean 上に、MBeanServer に登録されていないカスタム ModelMBeanInfo を設定できます。
ModelMBean の ModelMBeanInfo (Descriptor 付き) をカスタマイズし、ModelMBean に設定したあと、ModelMBean を MBeanServer に登録することができます。

ModelMBean が現在登録されている場合、このメソッドは IllegalStateException をラップする RuntimeOperationsException をスローします。

指定の inModelMBeanInfoGENERIC または ATTRIBUTE_CHANGE 通知の ModelMBeanNotificationInfo が含まれない場合、RequiredModelMBean により、デフォルトの ModelMBeanNotificationInfo が提供されます。

定義:
インタフェース ModelMBean 内の setModelMBeanInfo
パラメータ:
mbi - ModelMBean によって使用される ModelMBeanInfo オブジェクト
例外:
MBeanException - 分散通信 Exception を ラップする
RuntimeOperationsException -

setManagedResource

public void setManagedResource(Object mr,
                               String mr_type)
                        throws MBeanException,
                               RuntimeOperationsException,
                               InstanceNotFoundException,
                               InvalidTargetObjectTypeException
この ModelMBean 管理インタフェース内のすべてのメソッド (MBeanInfo と Descriptor) の実行対象となる、オブジェクトのインスタンスハンドルを設定します。

定義:
インタフェース ModelMBean 内の setManagedResource
パラメータ:
mr - 管理対象のリソースになっているオブジェクト
mr_type - 管理対象のリソースの参照の型
ObjectReference、Handle、IOR、EJBHandle、 または RMIReference
この実装でサポートされるのは ObjectReference のみ
例外:
MBeanException - オブジェクトのイニシャライザが 例外をスローした場合
InstanceNotFoundException - 管理対象のリソースオブジェクトが 見つからない場合
InvalidTargetObjectTypeException - 管理対象のリソースの型は ObjectReference でなければならない
RuntimeOperationsException - リソースの設定時に RuntimeException をラップする

load

public void load()
          throws MBeanException,
                 RuntimeOperationsException,
                 InstanceNotFoundException

この MBean インスタンスを持続ストア内の MBean 用データでインスタンス化します。データとして、属性とオペレーションの値をロードできます。

このメソッドは、このインスタンスの構築または初期化時、MBean を MBeanServer に登録する前に呼び出します。

このクラスの実装が持続性をサポートしない場合、ServiceNotFoundException をラップする MBeanException がスローされます。

定義:
インタフェース PersistentMBean 内の load
例外:
MBeanException - その他の例外をラップする場合、 または持続性がサポートされない場合
RuntimeOperationsException - 持続機構からの例外を ラップする場合
InstanceNotFoundException - この MBean が見つからない場合、 または持続ストレージからロードできない場合

store

public void store()
           throws MBeanException,
                  RuntimeOperationsException,
                  InstanceNotFoundException

この MBean インスタンスの現在の状態を取り込み、持続ストアに書き出します。属性やオペレーションの値が、状態として格納される場合もあります。

このクラスの実装が持続性をサポートしない場合、ServiceNotFoundException をラップする MBeanException がスローされます。

MBean の持続性ポリシーおよび属性記述子を使って、このメソッドの実行を制御します。persistPolicy フィールドが次の内容になっている場合、MBean は格納されます。

  != "never"
   = "always"
   = "onTimer" and now > 'lastPersistTime' + 'persistPeriod'
   = "NoMoreOftenThan" and now > 'lastPersistTime' + 'persistPeriod'
   = "onUnregister"
 

persistPolicy フィールドが次の内容になっている場合、MBean は格納されません。

    != "never"
    = "onUpdate"
    = "onTimer" && now < 'lastPersistTime' + 'persistPeriod'
 

定義:
インタフェース PersistentMBean 内の store
例外:
MBeanException - その他の例外をラップする場合、 または持続性がサポートされない場合
RuntimeOperationsException - 持続機構からの例外を ラップする場合
InstanceNotFoundException - 持続ストアが見つからない場合、 またはアクセスできない場合

getMBeanInfo

public MBeanInfo getMBeanInfo()
この RequiredModelMBean が管理用として公開する属性、オペレーション、コンストラクタ、および通知を返します。

定義:
インタフェース DynamicMBean 内の getMBeanInfo
戻り値:
ModelMBeanInfo のインスタンス。 この MBean のすべての属性、オペレーション、および通知の取得を許可する

invoke

public Object invoke(String opName,
                     Object[] opArgs,
                     String[] sig)
              throws MBeanException,
                     ReflectionException
RequiredModelMBean からメソッドを呼び出し、その実行結果を返します。

呼び出されるメソッドとシグニチャーが RequiredModelMbean からアクセス可能なメソッドのいずれかに一致している場合、このメソッドが呼び出されます。それ以外の場合、管理対象のリソース上で、指定のメソッドの呼び出しが試行されます。

オペレーションによって返される最後の値は、ModelMBeanOperationInfo の記述子内のオペレーション記述子にキャッシュされることがあります。有効な値が存在する場合、value フィールド内に存在します。値がキャッシュされるかどうかは、記述子内の currencyTimeLimit フィールドの値によって決まります。

注: 以前のバージョンの仕様との不整合があるため、currencyTimeLimit にはゼロ以下の値を使用しないようにしてください。キャッシュに入った値が有効でないことを示す場合は、currencyTimeLimit フィールドを省略します。この値が常に有効であることを示す場合は、このフィールドに非常に大きい値を指定します。

定義:
インタフェース DynamicMBean 内の invoke
パラメータ:
opName - 呼び出されるメソッドの名前。クラス名を含む完全修飾メソッド名。 オペレーション記述子の class フィールドに クラス名が定義されている場合はメソッド名のみ
opArgs - オペレーションの呼び出し時に設定される パラメータを含む配列
sig - オペレーションのシグニチャーを 含む配列。クラスオブジェクトのロードには、 オペレーションを呼び出した MBean をロードするときと 同じクラスローダーが使用される
戻り値:
メソッドによって返されるオブジェクト。 指定された管理対象のリソース上でメソッドを呼び出した結果を表す
例外:
MBeanException - 次のいずれかの Exception をラップする:
  • 管理対象オブジェクトの呼び出しメソッドによってスローされた Exception
  • ServiceNotFoundException。ModelMBeanOperationInfo が存在しない場合、 指定のオペレーションの記述子が定義されていない場合、 または管理対象のリソースが null の場合
  • InvalidTargetObjectTypeException。targetType フィールドの値が objectReference でない場合
ReflectionException - メソッドの呼び出し時にスローされる Exception をラップする
RuntimeOperationsException - IllegalArgumentException を をラップする。 メソッド名が null の場合

getAttribute

public Object getAttribute(String attrName)
                    throws AttributeNotFoundException,
                           MBeanException,
                           ReflectionException
この ModelMBean に定義された特定の属性の値を返します。属性によって返される最後の値は、属性の記述子内にキャッシュされることがあります。有効な値が存在する場合、value フィールド内に存在します。値がキャッシュされるかどうかは、記述子内の currencyTimeLimit フィールドの値によって決まります。

注: 以前のバージョンの仕様との不整合があるため、currencyTimeLimit にはゼロ以下の値を使用しないようにしてください。キャッシュに入った値が有効でないことを示す場合は、currencyTimeLimit フィールドを省略します。この値が常に有効であることを示す場合は、このフィールドに非常に大きい値を指定します。

getMethod フィールドに有効なオペレーション記述子の名前が含まれる場合、このオペレーション記述子によって記述されたメソッドが実行されます。メソッドは、応答として属性値を返します。オペレーションが失敗した場合、または戻り値の型が属性の宣言型と互換性がない場合、例外がスローされます。

getMethod フィールドが定義されていない場合、属性のデフォルト値が返されます。戻り値の型が属性の宣言型と互換性がない場合、例外がスローされます。

属性の宣言型は、MBeanAttributeInfo.getType() により返される String です。次のいずれかが当てはまる場合、値はこの型と互換性があります。

この実装で、getMethod を呼び出す必要がある場合は、呼び出しが正常に行われるように、この getMethod に対してオペレーションを指定する必要があります。これは、メソッドが標準の呼び出しメソッドから呼び出され、operationInfo が必要になるからです。

定義:
インタフェース DynamicMBean 内の getAttribute
パラメータ:
attrName - 取得する属性の名前を 指定する StringModelMBeanAttributeInfo の名前に 一致している必要がある
戻り値:
記述子の value フィールドから取得した属性の値。 または、記述子の getMethod フィールド内の オペレーションの呼び出しによって取得した属性の値
例外:
AttributeNotFoundException - 指定の属性が MBean に アクセスできない場合。 次の場合、AttributeNotFoundException がスローされる可能性がある
  • ModelMBean の ModelMBeanInfo が見つからない場合
  • 指定の属性名の ModelMBeanAttributeInfo が 見つからない場合
  • ModelMBeanAttributeInfo の isReadable メソッドの戻り値が false の場合
MBeanException - 次のいずれかの Exception をラップする:
  • InvalidAttributeValueException。属性の取得メソッドから受け取った値の型が不正な場合、 または属性の記述子内に getMethod フィールドが 定義されておらず、 デフォルト値が存在しない場合
  • ServiceNotFoundException。属性の 取得メソッドに対して ModelMBeanOperationInfo が定義されていない場合、 ModelMBeanOperationInfo に記述子が 関連付けられていない場合、または管理対象のリソースが null の場合
  • InvalidTargetObjectTypeException。targetType フィールドの値が objectReference でない場合
  • 管理対象オブジェクトの取得メソッドによってスローされた Exception
ReflectionException - 取得メソッドの呼び出し時にスローされる Exception をラップする
RuntimeOperationsException - IllegalArgumentException を ラップする。パラメータ内の属性名が null の場合
関連項目:
setAttribute(javax.management.Attribute)

getAttributes

public AttributeList getAttributes(String[] attrNames)
ModelMBean 内の複数の属性の値を返します。渡される attrNames 配列内の属性名ごとに getAttribute を実行します。

定義:
インタフェース DynamicMBean 内の getAttributes
パラメータ:
attrNames - 取得される属性の名前から成る String 配列
戻り値:
取得される属性の配列
例外:
RuntimeOperationsException - IllegalArgumentException を ラップする。すなわち、パラメータ内のオブジェクト名が null であるか、 パラメータ内の属性が null
関連項目:
setAttributes(javax.management.AttributeList)

setAttribute

public void setAttribute(Attribute attribute)
                  throws AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException
指定の ModelMBean の特定の属性の値を設定します。 属性の記述子の setMethod フィールドに有効なオペレーション記述子の名前が含まれる場合、このオペレーション記述子によって記述されたメソッドが実行されます。この実装では、setMethod を正常に動作させるため、オペレーション記述子を正しく指定し、modelMBeanInfo に割り当てる必要があります。メソッドからの応答内容は、記述子内の属性の値として設定されます。

currencyTimeLimit が > 0 の場合、属性の新しい値が属性記述子の value フィールドにキャッシュされ、lastUpdatedTimeStamp フィールドに現在のタイムスタンプが設定されます。

属性の記述子の持続フィールドが null 以外の場合、持続ストア内に属性を格納するため、属性記述子の Persistance ポリシーが使用されます。
persistPolicy フィールドが次の内容になっている場合、MBean が格納されます。

persistPolicy フィールドが次の内容になっている場合、MBean は格納されません。

Model MBean の ModelMBeanInfo はファイルに格納されます。

定義:
インタフェース DynamicMBean 内の setAttribute
パラメータ:
attribute - 設定される属性の名前と 設定値を含む Attribute インスタンス
例外:
AttributeNotFoundException - 指定の属性が MBean に アクセスできない場合
次の場合、AttributeNotFoundException がスローされる可能性がある
  • 指定の属性の ModelMBeanAttributeInfo が 見つからない場合
  • ModelMBeanAttributeInfo の isWritable メソッドの戻り値が false の場合
InvalidAttributeValueException - 指定の属性に記述子が 定義されていない場合
MBeanException - 次のいずれかの Exception をラップする:
  • 管理対象オブジェクトの設定メソッドによってスローされた Exception
  • ServiceNotFoundException。属性の記述子に setMethod フィールドが定義されておらず、管理対象の リソースが null の場合。または setMethod フィールドが定義されておらず、 属性でキャッシュが有効になっていない場合。 getMethod フィールドも存在しない場合は、 キャッシュが自動的に有効になる
  • InvalidTargetObjectTypeException。targetType フィールドの値が objectReference でない場合
  • 管理対象オブジェクトの取得メソッドによってスローされた Exception
ReflectionException - 設定メソッドの呼び出し時にスローされる Exception をラップする
RuntimeOperationsException - IllegalArgumentException を ラップする。パラメータ内の属性が null の場合
関連項目:
getAttribute(java.lang.String)

setAttributes

public AttributeList setAttributes(AttributeList attributes)
この ModelMBean の属性の配列の値を設定します。リスト内の各属性に対して setAttribute() メソッドを実行します。

定義:
インタフェース DynamicMBean 内の setAttributes
パラメータ:
attributes - 属性のリスト。(設定される属性の ID と 設定される値)
戻り値:
Attribute インスタンス内の新しい値で 設定された属性の配列
例外:
RuntimeOperationsException - IllegalArgumentException を ラップする。すなわち、パラメータ内のオブジェクト名が null であるか、 パラメータ内の属性が null
関連項目:
getAttributes(java.lang.String[])

addNotificationListener

public void addNotificationListener(NotificationListener listener,
                                    NotificationFilter filter,
                                    Object handback)
                             throws IllegalArgumentException
NotificationListener インタフェースを実装するオブジェクトをリスナーとして登録します。ModelMBean によって任意の通知が発行されると、このオブジェクトの handleNotification() メソッドが呼び出されます。attributeChangeNotification は含みません。これらは個別に登録する必要があります。

定義:
インタフェース NotificationBroadcaster 内の addNotificationListener
パラメータ:
listener - 登録済み MBean が発行した通知を 処理するリスナーオブジェクト
filter - フィルタオブジェクト。null の場合、 通知処理の前にフィルタは適用されない
handback - 通知が発行されたときに通知とともに リスナーに送信されるコンテキスト
例外:
IllegalArgumentException - リスナーは null にできない
関連項目:
removeNotificationListener(javax.management.NotificationListener)

removeNotificationListener

public void removeNotificationListener(NotificationListener listener)
                                throws ListenerNotFoundException
RequiredModelMBean から Notification のリスナーを削除します。

定義:
インタフェース NotificationBroadcaster 内の removeNotificationListener
パラメータ:
listener - 登録済み MBean が発行した 通知を処理していたリスナーの名前。 このメソッドはこのリスナーに関するすべての情報を削除する
例外:
ListenerNotFoundException - リスナーが MBean に 登録されていないか、null の場合
関連項目:
addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)

removeNotificationListener

public void removeNotificationListener(NotificationListener listener,
                                       NotificationFilter filter,
                                       Object handback)
                                throws ListenerNotFoundException
インタフェース NotificationEmitter の記述:

この MBean からリスナーを削除します。MBean は、指定された listenerfilter、および handback パラメータと正確に一致するリスナーを持っている必要があります。該当するリスナーが複数存在する場合、そのうちの 1 つだけが削除されます。

削除されるリスナー内で null が指定されている場合、filter および handback パラメータは null になります。

定義:
インタフェース NotificationEmitter 内の removeNotificationListener
パラメータ:
listener - 以前にこの MBean に追加された リスナー
filter - リスナーの追加時に指定された フィルタ
handback - リスナーの追加時に指定された ハンドバック
例外:
ListenerNotFoundException - リスナーが MBean に 登録されていない場合、または指定されたフィルタおよびハンドバックで 登録されていない場合

sendNotification

public void sendNotification(Notification ntfyObj)
                      throws MBeanException,
                             RuntimeOperationsException
インタフェース ModelMBeanNotificationBroadcaster の記述:
ModelMBean 上の登録済み Notification リスナーに、jmx.modelmbean.generic 通知として渡される Notification を送信します。

定義:
インタフェース ModelMBeanNotificationBroadcaster 内の sendNotification
パラメータ:
ntfyObj - リスナーオブジェクトの handleNotification メソッドに渡される通知
例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - IllegalArgumentException をラップする。 パラメータとして渡された Notification オブジェクトが null の場合

sendNotification

public void sendNotification(String ntfyText)
                      throws MBeanException,
                             RuntimeOperationsException
インタフェース ModelMBeanNotificationBroadcaster の記述:
ModelMBean 上の登録済み Notification リスナーに渡されるテキスト文字列を含む Notification を送信します。

定義:
インタフェース ModelMBeanNotificationBroadcaster 内の sendNotification
パラメータ:
ntfyText - Notification に指定され、 リスナーオブジェクトの handleNotification メソッドに渡されるテキスト。 構築済みの Notification を次に示します。 type "jmx.modelmbean.generic" source この ModelMBean インスタンス sequence 1
例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - IllegalArgumentException をラップする。 パラメータとして渡された Notification テキスト文字列が null の場合

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
RequiredModelMBean によって生成された Notification の配列を返します。

RequiredModelMBean は、2 つの追加通知を送信する場合があります。

これらの 2 つの通知は、アプリケーションによって指定された通知に常に追加されます。

定義:
インタフェース NotificationBroadcaster 内の getNotificationInfo
戻り値:
MBeanNotificationInfo[]

addAttributeChangeNotificationListener

public void addAttributeChangeNotificationListener(NotificationListener inlistener,
                                                   String inAttributeName,
                                                   Object inhandback)
                                            throws MBeanException,
                                                   RuntimeOperationsException,
                                                   IllegalArgumentException
インタフェース ModelMBeanNotificationBroadcaster の記述:
NotificationListener インタフェースを実装するオブジェクトをリスナーとして登録します。ModelMBean によって任意の attributeChangeNotification が発行されると、このオブジェクトの handleNotification() メソッドが呼び出されます。その他の Notification は含みません。これらは個別に登録する必要があります。この attributeName 用の AttributeChangeNotification が生成されます。

定義:
インタフェース ModelMBeanNotificationBroadcaster 内の addAttributeChangeNotificationListener
パラメータ:
inlistener - 登録済み MBean が発行した通知を処理するリスナーオブジェクト
inAttributeName - ModelMBean 属性の名前。この属性の変更通知を受信する。 null の場合、どの属性が変更されたときも attributeChangeNotification が発行される
inhandback - 通知が発行されたとき通知とともにリスナーに送信されるコンテキスト
例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - IllegalArgumentException をラップする。パラメータとして渡される属性名が存在しない場合
IllegalArgumentException - リスナーは null にできない
関連項目:
ModelMBeanNotificationBroadcaster.removeAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String)

removeAttributeChangeNotificationListener

public void removeAttributeChangeNotificationListener(NotificationListener inlistener,
                                                      String inAttributeName)
                                               throws MBeanException,
                                                      RuntimeOperationsException,
                                                      ListenerNotFoundException
インタフェース ModelMBeanNotificationBroadcaster の記述:
RequiredModelMBean から attributeChangeNotification のリスナーを削除します。

定義:
インタフェース ModelMBeanNotificationBroadcaster 内の removeAttributeChangeNotificationListener
パラメータ:
inlistener - 登録済み MBean が発行した通知を処理していたリスナーの名前。 このメソッドはこのリスナーに関するすべての情報を削除する
inAttributeName - 属性。リスナーは、この属性の attributeChangeNotification を受信する必要がなくなった。 null の場合、すべての attributeChangeNotification のリスナーが削除される
例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - inAttributeName パラメータが属性名に一致しない場合、 IllegalArgumentException をラップする。
ListenerNotFoundException - リスナーが MBean に登録されていないか、null の場合
関連項目:
ModelMBeanNotificationBroadcaster.addAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String, java.lang.Object)

sendAttributeChangeNotification

public void sendAttributeChangeNotification(AttributeChangeNotification ntfyObj)
                                     throws MBeanException,
                                            RuntimeOperationsException
インタフェース ModelMBeanNotificationBroadcaster の記述:
ModelMBean 上の登録済み attributeChangeNotification リスナーに渡される attributeChangeNotification を送信します。

定義:
インタフェース ModelMBeanNotificationBroadcaster 内の sendAttributeChangeNotification
パラメータ:
ntfyObj - リスナーオブジェクトの handleNotification メソッドに渡される通知
例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - IllegalArgumentException をラップする。パラメータとして渡された AttributeChangeNotification オブジェクトが null の場合

sendAttributeChangeNotification

public void sendAttributeChangeNotification(Attribute inOldVal,
                                            Attribute inNewVal)
                                     throws MBeanException,
                                            RuntimeOperationsException
インタフェース ModelMBeanNotificationBroadcaster の記述:
ModelMBean 上の登録済み AttributeChangeNotification リスナーに、属性の古い値と新しい値を含む attributeChangeNotification を送信します。

定義:
インタフェース ModelMBeanNotificationBroadcaster 内の sendAttributeChangeNotification
パラメータ:
inOldVal - Attribute の初期値
inNewVal - Attribute の現在の値

  
 構築済みの attributeChangeNotification。
   type        "jmx.attribute.change"
   source      この ModelMBean インスタンス
   sequence    1
   attributeName oldValue.getName()
   attributeType oldValue のクラス
   attributeOldValue oldValue.getValue()
   attributeNewValue newValue.getValue()
 
例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - IllegalArgumentException をラップする。パラメータとして渡される Attribute オブジェクトが null である場合、 またはパラメータに同じ名前の Attribute オブジェクトが複数指定された場合

getClassLoaderRepository

protected ClassLoaderRepository getClassLoaderRepository()
クラスのロードに使用されたクラスローダーリポジトリを返します。サブクラスは、このオブジェクト内で使用する適切な ClassLoaderRepository を返すため、このメソッドを再定義することができます。

戻り値:
クラスローダーリポジトリ

preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
                       throws Exception
MBean サーバーに登録する前に、MBean に必要なオペレーションを実行させることができます。MBean の名前を指定しないと、MBean により、登録用の名前が提供されます。例外がスローされた場合、MBean は MBean サーバーに登録されません。

RequireModelMBean が実行時に適切に機能するように、このメソッドをオーバーロードまたはオーバーライドする RequiredModelMBean のサブクラスは、固有の preRegister 実装内の super.preRegister(server, name) を呼び出す必要があります。

定義:
インタフェース MBeanRegistration 内の preRegister
パラメータ:
server - MBean サーバー。MBean はここに登録される
name - MBean のオブジェクト名MBeanServer インタフェース内の createMBean または registerMBean メソッドの name パラメータが null の場合、 この名前は null になる。この場合、このメソッドは、 新しい MBean 用に null 以外の ObjectName を必ず返す
戻り値:
MBean の登録名。 null は指定できない。name パラメータが null 以外の場合、通常は値が返されるが、 これは必須ではない
例外:
Exception - この例外は、MBean サーバーにキャッチされ、 MBeanRegistrationException として再スローされる

postRegister

public void postRegister(Boolean registrationDone)
MBean サーバーへの登録が成功または失敗したあと、MBean が必要なオペレーションを実行できるようにします。

RequireModelMBean が実行時に適切に機能するように、このメソッドをオーバーロードまたはオーバーライドする RequiredModelMBean のサブクラスは、固有の postRegister 実装内の super.postRegister(registrationDone) を呼び出す必要があります。

定義:
インタフェース MBeanRegistration 内の postRegister
パラメータ:
registrationDone - MBean が MBean サーバーに 正常に登録されたかどうかを示す。登録に 失敗した場合の値は false

preDeregister

public void preDeregister()
                   throws Exception
MBean サーバーから登録解除する前に、MBean が必要なオペレーションを実行できるようにします。

RequireModelMBean が実行時に適切に機能するように、このメソッドをオーバーロードまたはオーバーライドする RequiredModelMBean のサブクラスは、固有の preDeregister 実装内の super.preDeregister() を呼び出す必要があります。

定義:
インタフェース MBeanRegistration 内の preDeregister
例外:
Exception - この例外は、MBean サーバーにキャッチされ、 MBeanRegistrationException として再スローされる

postDeregister

public void postDeregister()
MBean サーバーから登録解除したあと、MBean が必要なオペレーションを実行できるようにします。

RequireModelMBean が実行時に適切に機能するように、このメソッドをオーバーロードまたはオーバーライドする RequiredModelMBean のサブクラスは、固有の postDeregister 実装内の super.postDeregister() を呼び出す必要があります。

定義:
インタフェース MBeanRegistration 内の postDeregister

JavaTM Platform
Standard Ed. 6

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

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