JavaTM Platform
Standard Ed. 6

javax.management.modelmbean
クラス ModelMBeanInfoSupport

java.lang.Object
  上位を拡張 javax.management.MBeanInfo
      上位を拡張 javax.management.modelmbean.ModelMBeanInfoSupport
すべての実装されたインタフェース:
Serializable, Cloneable, DescriptorRead, ModelMBeanInfo

public class ModelMBeanInfoSupport
extends MBeanInfo
implements ModelMBeanInfo

このクラスは、ModelMBean のメタデータを表します。メタデータオブジェクトに記述子が追加されています。

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

MBeanServer でインスタンス化された MBean はすべて管理対象となります。これらの属性およびオペレーションには、MBeanServer に接続されたコネクタまたはアダプタ経由でリモートアクセスできます。JMX 準拠の MBean でない Java オブジェクトは、MBeanServer に登録できません。リソースは、ModelMBean をインスタンス化することにより、MBean の有効性を保証します。 すべての public メソッドで、MBeanException および RuntimeOperationsException がスローされる必要があります。これにより、分散型通信 (RMI、EJB など) からの例外のラップが可能になります。  

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

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

コンストラクタの概要
ModelMBeanInfoSupport(ModelMBeanInfo mbi)
          指定された ModelMBeanInfo を複製して ModelMBeanInfoSupport を構築します。
ModelMBeanInfoSupport(String className, String description, ModelMBeanAttributeInfo[] attributes, ModelMBeanConstructorInfo[] constructors, ModelMBeanOperationInfo[] operations, ModelMBeanNotificationInfo[] notifications)
          提供された情報で ModelMBeanInfoSupport を作成します。
ModelMBeanInfoSupport(String className, String description, ModelMBeanAttributeInfo[] attributes, ModelMBeanConstructorInfo[] constructors, ModelMBeanOperationInfo[] operations, ModelMBeanNotificationInfo[] notifications, Descriptor mbeandescriptor)
          提供された情報とパラメータとして指定された記述子を使って ModelMBeanInfoSupport を作成します。
 
メソッドの概要
 Object clone()
          このインスタンスのシャローコピーを返します。
 ModelMBeanAttributeInfo getAttribute(String inName)
          名前で要求された ModelMBeanAttributeInfo を返します。
 ModelMBeanConstructorInfo getConstructor(String inName)
          名前で要求された ModelMBeanConstructorInfo を返します。
 Descriptor getDescriptor()
          この MBeanInfo の記述子を取得します。
 Descriptor getDescriptor(String inDescriptorName)
          名前で要求された Descriptor を返します。
 Descriptor getDescriptor(String inDescriptorName, String inDescriptorType)
          名前と descriptorType で要求された Descriptor を返します。
 Descriptor[] getDescriptors(String inDescriptorType)
          inDescriptorType 型の ModelMBeanInfo のすべての Descriptor で構成される Descriptor 配列を返します。
 Descriptor getMBeanDescriptor()
          MBean 全体ポリシーを含む ModelMBean の記述子を返します。
 ModelMBeanNotificationInfo getNotification(String inName)
          名前で要求された ModelMBeanNotificationInfo を返します。
 ModelMBeanOperationInfo getOperation(String inName)
          名前で要求された ModelMBeanOperationInfo を返します。
 void setDescriptor(Descriptor inDescriptor, String inDescriptorType)
          ModelMBean の inDescriptorType 型の情報配列内に記述子を設定します。
 void setDescriptors(Descriptor[] inDescriptors)
          ModelMBeanInfo に記述子を追加するか、ModelMBeanInfo 内の記述子を置き換えます。
 void setMBeanDescriptor(Descriptor inMBeanDescriptor)
          ModelMBean の記述子を設定します。
 
クラス javax.management.MBeanInfo から継承されたメソッド
equals, getAttributes, getClassName, getConstructors, getDescription, getNotifications, getOperations, hashCode, toString
 
クラス java.lang.Object から継承されたメソッド
finalize, getClass, notify, notifyAll, wait, wait, wait
 
インタフェース javax.management.modelmbean.ModelMBeanInfo から継承されたメソッド
getAttributes, getClassName, getConstructors, getDescription, getNotifications, getOperations
 

コンストラクタの詳細

ModelMBeanInfoSupport

public ModelMBeanInfoSupport(ModelMBeanInfo mbi)
指定された ModelMBeanInfo を複製して ModelMBeanInfoSupport を構築します。返されるオブジェクトは、指定したオブジェクトのシャローコピーです。Descriptor も、含まれる配列 (ModelMBeanAttributeInfo[] など) も複製されません。このメソッドの主な用途は、setDescriptor を使って、元のオブジェクトの Descriptor に影響を及ぼすことなく、返されるインスタンスの Descriptor を変更することです。

パラメータ:
mbi - ModelMBeanInfo インスタンス。 このインスタンスから作成した ModelMBeanInfo が初期化される

ModelMBeanInfoSupport

public ModelMBeanInfoSupport(String className,
                             String description,
                             ModelMBeanAttributeInfo[] attributes,
                             ModelMBeanConstructorInfo[] constructors,
                             ModelMBeanOperationInfo[] operations,
                             ModelMBeanNotificationInfo[] notifications)
提供された情報で ModelMBeanInfoSupport を作成します。記述子はデフォルトのものが使用されます。デフォルトの記述子は、name=mbeanName, descriptorType=mbean, displayName=ClassName, persistPolicy=never, log=F, visibility=1 です。

パラメータ:
className - MBean のクラス名
description - 人間が読める形式の ModelMBean の説明
attributes - 記述子を持つ ModelMBeanAttributeInfo オブジェクトの 配列
constructors - 記述子を持つ ModelMBeanConstructorInfo オブジェクトの 配列
operations - 記述子を持つ ModelMBeanOperationInfo オブジェクトの 配列
notifications - 記述子を持つ ModelMBeanNotificationInfo オブジェクトの 配列

ModelMBeanInfoSupport

public ModelMBeanInfoSupport(String className,
                             String description,
                             ModelMBeanAttributeInfo[] attributes,
                             ModelMBeanConstructorInfo[] constructors,
                             ModelMBeanOperationInfo[] operations,
                             ModelMBeanNotificationInfo[] notifications,
                             Descriptor mbeandescriptor)
提供された情報とパラメータとして指定された記述子を使って ModelMBeanInfoSupport を作成します。

パラメータ:
className - MBean のクラス名
description - 人間が読める形式の ModelMBean の説明
attributes - 記述子を持つ ModelMBeanAttributeInfo オブジェクトの 配列
constructors - 記述子を持つ ModelMBeanConstructorInfo オブジェクトの 配列
operations - 記述子を持つ ModelMBeanOperationInfo オブジェクトの 配列
notifications - 記述子を持つ ModelMBeanNotificationInfo オブジェクトの 配列
mbeandescriptor - MBean 全体ポリシーを含む MBeanDescriptor として 使用される記述子。記述子が null の場合、 デフォルトの記述子が作成される。デフォルトの記述子は、name=className, descriptorType=mbean, displayName=className, persistPolicy=never, log=F, visibility=1。 記述子に これらのフィールドすべてが含まれない場合は、 デフォルト値で追加される
例外:
RuntimeOperationsException - Wraps an IllegalArgumentException for invalid descriptor passed in parameter. (see getMBeanDescriptor for the definition of a valid MBean descriptor.)
メソッドの詳細

clone

public Object clone()
このインスタンスのシャローコピーを返します。Descriptor も、含まれる配列 (ModelMBeanAttributeInfo[] など) も複製されません。このメソッドの主な用途は、setDescriptor を使って、元のオブジェクトの Descriptor に影響を及ぼすことなく、複製の Descriptor を変更することです。

定義:
インタフェース ModelMBeanInfo 内の clone
オーバーライド:
クラス MBeanInfo 内の clone
戻り値:
このインスタンスのシャロー複製
関連項目:
Cloneable

getDescriptors

public Descriptor[] getDescriptors(String inDescriptorType)
                            throws MBeanException,
                                   RuntimeOperationsException
インタフェース ModelMBeanInfo の記述:
inDescriptorType 型の ModelMBeanInfo のすべての Descriptor で構成される Descriptor 配列を返します。

定義:
インタフェース ModelMBeanInfo 内の getDescriptors
パラメータ:
inDescriptorType - 返される記述子に対して設定する必要がある descriptorType フィールドの値。mbean、attribute、operation、constructor、notification のいずれか。null または空の場合、すべての型が返される
戻り値:
型が inDescriptorType の場合、この ModelMBean のすべての記述子を含む記述子配列
例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - パラメータとして渡された descriptorType が mbean、attribute、operation、constructor、notification のいずれでもない場合、 空の場合、または null の場合、IllegalArgumentException をラップする
関連項目:
ModelMBeanInfo.setDescriptors(javax.management.Descriptor[])

setDescriptors

public void setDescriptors(Descriptor[] inDescriptors)
                    throws MBeanException,
                           RuntimeOperationsException
インタフェース ModelMBeanInfo の記述:
ModelMBeanInfo に記述子を追加するか、ModelMBeanInfo 内の記述子を置き換えます。

定義:
インタフェース ModelMBeanInfo 内の setDescriptors
パラメータ:
inDescriptors - ModelMBeanInfo 内に設定される記述子。リストの null 要素は 無視される。すべての記述子が name および descriptorType フィールドを持っている必要がある
例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - 記述子が null または不正な場合、IllegalArgumentException をラップする
関連項目:
ModelMBeanInfo.getDescriptors(java.lang.String)

getDescriptor

public Descriptor getDescriptor(String inDescriptorName)
                         throws MBeanException,
                                RuntimeOperationsException
名前で要求された Descriptor を返します。

パラメータ:
inDescriptorName - 記述子の名前
戻り値:
同じ名前の ModelMBean の記述子を含む 記述子。記述子が見つからない場合、null が返される
例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - 名前が null の場合、 IllegalArgumentException をラップする
関連項目:
setDescriptor(javax.management.Descriptor, java.lang.String)

getDescriptor

public Descriptor getDescriptor(String inDescriptorName,
                                String inDescriptorType)
                         throws MBeanException,
                                RuntimeOperationsException
インタフェース ModelMBeanInfo の記述:
名前と descriptorType で要求された Descriptor を返します。

定義:
インタフェース ModelMBeanInfo 内の getDescriptor
パラメータ:
inDescriptorName - 記述子の名前
inDescriptorType - 要求される記述子の 型。null または空の場合、 すべての型が検索される。有効な型は、mbean、attribute、constructor、 operation、および notification。この値は、 返される記述子の descriptorType フィールドと等しくなる
戻り値:
同じ名前および descriptorType の ModelMBean の記述子を 含む記述子。記述子が見つからない場合、null が返される
例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - 記述子名が null であるか、型が null または不正な場合、IllegalArgumentException をラップする。型は、mbean、attribute、constructor、operation、notification のいずれかでなければならない
関連項目:
ModelMBeanInfo.setDescriptor(javax.management.Descriptor, java.lang.String)

setDescriptor

public void setDescriptor(Descriptor inDescriptor,
                          String inDescriptorType)
                   throws MBeanException,
                          RuntimeOperationsException
インタフェース ModelMBeanInfo の記述:
ModelMBean の inDescriptorType 型の情報配列内に記述子を設定します。指定された記述子を設定するため、対応する ModelMBean*Info の setDescriptor メソッドが呼び出されます。

定義:
インタフェース ModelMBeanInfo 内の setDescriptor
パラメータ:
inDescriptor - ModelMBean 内に設定される 記述子。null 以外でなければならない。すべての記述子が name および descriptorType フィールドを持っている必要がある
inDescriptorType - 設定される記述子の 型。null の場合、記述子の descriptorType フィールドが 使用される。指定されている場合、この値が記述子の descriptorType フィールドに 設定されなければならない。mbean、attribute、constructor、 operation、 notification のいずれか
例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - 引数が不正または null である場合、 または対応する MBeanAttributeInfo、 MBeanConstructorInfo、 MBeanNotificationInfo、 MBeanOperationInfo のいずれかで
関連項目:
ModelMBeanInfo.getDescriptor(java.lang.String, java.lang.String)

getAttribute

public ModelMBeanAttributeInfo getAttribute(String inName)
                                     throws MBeanException,
                                            RuntimeOperationsException
インタフェース ModelMBeanInfo の記述:
名前で要求された ModelMBeanAttributeInfo を返します。

定義:
インタフェース ModelMBeanInfo 内の getAttribute
パラメータ:
inName - 取得する ModelMBeanAttributeInfo の名前。この名前の ModelMBeanAttributeInfo が存在しない場合は null が返される
戻り値:
指定された属性の属性情報。 存在しない場合は null
例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - 属性名が null の場合、 IllegalArgumentException をラップする

getOperation

public ModelMBeanOperationInfo getOperation(String inName)
                                     throws MBeanException,
                                            RuntimeOperationsException
インタフェース ModelMBeanInfo の記述:
名前で要求された ModelMBeanOperationInfo を返します。

定義:
インタフェース ModelMBeanInfo 内の getOperation
パラメータ:
inName - 取得する ModelMBeanOperationInfo の名前。この名前の ModelMBeanOperationInfo が存在しない場合は null が返される
戻り値:
指定されたオペレーションのオペレーション情報。 存在しない場合は null
例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - オペレーション名が null の場合 IllegalArgumentException をラップする

getConstructor

public ModelMBeanConstructorInfo getConstructor(String inName)
                                         throws MBeanException,
                                                RuntimeOperationsException
名前で要求された ModelMBeanConstructorInfo を返します。この名前の ModelMBeanConstructorInfo が存在しない場合、null が返されます。

パラメータ:
inName - コンストラクタの名前
戻り値:
指定されたコンストラクタのコンストラクタ情報。 存在しない場合は null
例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - コンストラクタ名が null の場合、 IllegalArgumentException をラップする

getNotification

public ModelMBeanNotificationInfo getNotification(String inName)
                                           throws MBeanException,
                                                  RuntimeOperationsException
インタフェース ModelMBeanInfo の記述:
名前で要求された ModelMBeanNotificationInfo を返します。

定義:
インタフェース ModelMBeanInfo 内の getNotification
パラメータ:
inName - 取得する ModelMBeanNotificationInfo の名前。この名前の ModelMBeanNotificationInfo が存在しない場合は null が返される
戻り値:
指定された通知の情報。 存在しない場合は null
例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - 通知名が null の場合 IllegalArgumentException をラップする

getDescriptor

public Descriptor getDescriptor()
クラス MBeanInfo の記述:
この MBeanInfo の記述子を取得します。戻り値を変更しても、元の記述子は影響を受けません。

定義:
インタフェース DescriptorRead 内の getDescriptor
オーバーライド:
クラス MBeanInfo 内の getDescriptor
戻り値:
不変またはオリジナルのコピーである記述子
導入されたバージョン:
1.6

getMBeanDescriptor

public Descriptor getMBeanDescriptor()
                              throws MBeanException
インタフェース ModelMBeanInfo の記述:
MBean 全体ポリシーを含む ModelMBean の記述子を返します。この記述子には、MBean のメタデータと持続性機能およびキャッシング機能のデフォルトポリシーが含まれます。

記述子内のフィールドは次のように定義済みですが、この内容に限定されません。

 name           :MBean 名  
 descriptorType :必ず mbean   
 displayName    :ディスプレイで使用される属性の名前 
 persistPolicy  :OnUpdate、OnTimer、NoMoreOftenThan、OnUnregister、Always、Never  
 persistLocation :完全修飾ディレクトリ名。MBean は、必要に応じてこのディレクトリに保持される
 persistFile    :MBean を保持するファイルの名前
 persistPeriod  :秒数。OnTime および NoMoreOftenThan PersistPolicy の持続サイクルの頻度を表す 
 currencyTimeLimit :値の有効期間。 <0 無効、=0 常に有効、>0 秒  
 log            :t の場合はすべての通知をログに記録、f の場合は通知を記録しない
 logfile        :イベントの記録先ファイルの完全修飾ファイル名
 visibility            :1 〜 4 の値のうち 1:常に可視 4:ほとんど不可視
 export         :この MBean をエクスポートまたは公開するとき使用する名前。
 ほかの JMX エージェントはこの名前を使って MBean を検索する   
 presentationString :データ表現と MBean を関連付けるための XML 形式の文字列 
  

デフォルトの記述子は、name=mbeanName,descriptorType=mbean, displayName=this.getClassName(), persistPolicy=never,log=F,export=F,visibility=1 です。記述子にこれらのいずれかのフィールドが不足している場合、不足しているフィールドがデフォルト値で追加されます。  

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

定義:
インタフェース ModelMBeanInfo 内の getMBeanDescriptor
戻り値:
MBean 記述子
例外:
MBeanException - 分散通信 Exception をラップする
関連項目:
ModelMBeanInfo.setMBeanDescriptor(javax.management.Descriptor)

setMBeanDescriptor

public void setMBeanDescriptor(Descriptor inMBeanDescriptor)
                        throws MBeanException,
                               RuntimeOperationsException
インタフェース ModelMBeanInfo の記述:
ModelMBean の記述子を設定します。この記述子には、MBean に関する MBean 全体のデフォルトのメタデータと、持続性機能およびキャッシング機能のデフォルトポリシーが含まれます。このオペレーションは、記述子を完全に置換します。マージは行いません。記述子が null に設定された場合、デフォルトの記述子が作成されます。デフォルトの記述子は、name=mbeanName,descriptorType=mbean, displayName=this.getClassName(), persistPolicy=never,log=F,export=F,visibility=1 です。記述子にこれらのいずれかのフィールドが不足している場合、不足しているフィールドがデフォルト値で追加されます。 有効なフィールド名については、getMBeanDescriptor メソッドの javadoc を参照してください。

定義:
インタフェース ModelMBeanInfo 内の setMBeanDescriptor
パラメータ:
inMBeanDescriptor - 設定する記述子
例外:
MBeanException - 分散通信 Exception をラップする
RuntimeOperationsException - 記述子が無効な場合、IllegalArgumentException をラップする
関連項目:
ModelMBeanInfo.getMBeanDescriptor()

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 も参照してください。