public class ModelMBeanInfoSupport extends MBeanInfo implements ModelMBeanInfo
管理対象になる 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 です。
| コンストラクタと説明 |
|---|
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 の記述子を設定します。
|
equals, getAttributes, getClassName, getConstructors, getDescription, getNotifications, getOperations, hashCode, toStringgetAttributes, getClassName, getConstructors, getDescription, getNotifications, getOperationspublic ModelMBeanInfoSupport(ModelMBeanInfo mbi)
ModelMBeanAttributeInfo[] など) も複製されません。このメソッドの主な用途は、setDescriptor を使って、元のオブジェクトの Descriptor に影響を及ぼすことなく、返されるインスタンスの Descriptor を変更することです。mbi - ModelMBeanInfo インスタンス (このインスタンスから作成した ModelMBeanInfo が初期化される)。public ModelMBeanInfoSupport(String className, String description, ModelMBeanAttributeInfo[] attributes, ModelMBeanConstructorInfo[] constructors, ModelMBeanOperationInfo[] operations, ModelMBeanNotificationInfo[] notifications)
className - MBean のクラス名description - 人間が読める形式の ModelMBean の説明attributes - 記述子を持つ ModelMBeanAttributeInfo オブジェクトの配列constructors - 記述子を持つ ModelMBeanConstructorInfo オブジェクトの配列operations - 記述子を持つ ModelMBeanOperationInfo オブジェクトの配列notifications - 記述子を持つ ModelMBeanNotificationInfo オブジェクトの配列public ModelMBeanInfoSupport(String className, String description, ModelMBeanAttributeInfo[] attributes, ModelMBeanConstructorInfo[] constructors, ModelMBeanOperationInfo[] operations, ModelMBeanNotificationInfo[] notifications, Descriptor mbeandescriptor)
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 - パラメータに渡される記述子が無効な場合、IllegalArgumentException をラップする。(有効な MBean 記述子の定義については、getMBeanDescriptor を参照。)public Object clone()
ModelMBeanAttributeInfo[] など) も複製されません。このメソッドの主な用途は、setDescriptor を使って、元のオブジェクトの Descriptor に影響を及ぼすことなく、複製の Descriptor を変更することです。clone、インタフェース: ModelMBeanInfoclone、クラス: MBeanInfoCloneablepublic Descriptor[] getDescriptors(String inDescriptorType) throws MBeanException, RuntimeOperationsException
ModelMBeanInfogetDescriptors、インタフェース: ModelMBeanInfoinDescriptorType - 返される記述子に対して設定する必要がある descriptorType フィールドの値。mbean、attribute、operation、constructor、notification のいずれか。null または空の場合、すべての型が返される。MBeanException - 分散通信 Exception をラップする。RuntimeOperationsException - パラメータとして渡された descriptorType が次のいずれでもない場合、IllegalArgumentException をラップする。mbean、attribute、operation、constructor、notification、空の場合、または null の場合。ModelMBeanInfo.setDescriptors(javax.management.Descriptor[])public void setDescriptors(Descriptor[] inDescriptors) throws MBeanException, RuntimeOperationsException
ModelMBeanInfosetDescriptors、インタフェース: ModelMBeanInfoinDescriptors - ModelMBeanInfo 内に設定される記述子。リストの null 要素は無視される。すべての記述子が name および descriptorType フィールドを持っている必要がある。MBeanException - 分散通信 Exception をラップする。RuntimeOperationsException - 記述子が null または不正な場合、IllegalArgumentException をラップする。ModelMBeanInfo.getDescriptors(java.lang.String)public Descriptor getDescriptor(String inDescriptorName) throws MBeanException, RuntimeOperationsException
inDescriptorName - 記述子の名前。MBeanException - 分散通信 Exception をラップする。RuntimeOperationsException - 名前が null の場合、IllegalArgumentException をラップする。setDescriptor(javax.management.Descriptor, java.lang.String)public Descriptor getDescriptor(String inDescriptorName, String inDescriptorType) throws MBeanException, RuntimeOperationsException
ModelMBeanInfogetDescriptor、インタフェース: ModelMBeanInfoinDescriptorName - 記述子の名前。inDescriptorType - 要求される記述子の型。null または空の場合、すべての型が検索される。有効な型は、mbean、attribute、constructor、operation、および notification。この値は、返される記述子の descriptorType フィールドと等しくなる。MBeanException - 分散通信 Exception をラップする。RuntimeOperationsException - 記述子名が null であるか、型が null または不正な場合、IllegalArgumentException をラップする。型は、mbean、attribute、constructor、operation、notification のいずれかでなければならない。ModelMBeanInfo.setDescriptor(javax.management.Descriptor, java.lang.String)public void setDescriptor(Descriptor inDescriptor, String inDescriptorType) throws MBeanException, RuntimeOperationsException
ModelMBeanInfosetDescriptor、インタフェース: ModelMBeanInfoinDescriptor - ModelMBean 内に設定される記述子。null 以外でなければならない。すべての記述子が name および descriptorType フィールドを持っている必要がある。inDescriptorType - 設定される記述子の型。null の場合、記述子の descriptorType フィールドが使用される。指定されている場合、この値が記述子の descriptorType フィールドに設定されなければならない。mbean、attribute、constructor、operation、notification のいずれか。MBeanException - 分散通信 Exception をラップする。RuntimeOperationsException - 引数が不正または null である場合、または対応する MBeanAttributeInfo、MBeanConstructorInfo、MBeanNotificationInfo、MBeanOperationInfo のいずれかで記述子の name フィールドが見つからない場合、IllegalArgumentException をラップする。ModelMBeanInfo.getDescriptor(java.lang.String, java.lang.String)public ModelMBeanAttributeInfo getAttribute(String inName) throws MBeanException, RuntimeOperationsException
ModelMBeanInfogetAttribute、インタフェース: ModelMBeanInfoinName - 取得する ModelMBeanAttributeInfo の名前。この名前の ModelMBeanAttributeInfo が存在しない場合は null が返される。MBeanException - 分散通信 Exception をラップする。RuntimeOperationsException - 属性名が null の場合、IllegalArgumentException をラップする。public ModelMBeanOperationInfo getOperation(String inName) throws MBeanException, RuntimeOperationsException
ModelMBeanInfogetOperation、インタフェース: ModelMBeanInfoinName - 取得する ModelMBeanOperationInfo の名前。この名前の ModelMBeanOperationInfo が存在しない場合は null が返される。MBeanException - 分散通信 Exception をラップする。RuntimeOperationsException - オペレーション名が null の場合 IllegalArgumentException をラップする。public ModelMBeanConstructorInfo getConstructor(String inName) throws MBeanException, RuntimeOperationsException
inName - コンストラクタの名前。MBeanException - 分散通信 Exception をラップする。RuntimeOperationsException - コンストラクタ名が null の場合、IllegalArgumentException をラップする。public ModelMBeanNotificationInfo getNotification(String inName) throws MBeanException, RuntimeOperationsException
ModelMBeanInfogetNotification、インタフェース: ModelMBeanInfoinName - 取得する ModelMBeanNotificationInfo の名前。この名前の ModelMBeanNotificationInfo が存在しない場合は null が返される。MBeanException - 分散通信 Exception をラップする。RuntimeOperationsException - 通知名が null の場合 IllegalArgumentException をラップする。public Descriptor getDescriptor()
MBeanInfogetDescriptor、インタフェース: DescriptorReadgetDescriptor、クラス: MBeanInfopublic Descriptor getMBeanDescriptor() throws MBeanException
ModelMBeanInfoMBean 全体ポリシーを含む ModelMBean の記述子を返します。この記述子には、MBean のメタデータと永続性機能およびキャッシング機能のデフォルトポリシーが含まれます。
記述子内のフィールドは次のように定義済みですが、この内容に限定されません。この表で型が Number である場合は、Long の 10 進数表現である String を使用することもできます。
| 名前 | 型 | 意味 |
|---|---|---|
| name | String | MBean 名。 |
| descriptorType | String | 必ず mbean。 |
| displayName | String | ディスプレイで使用される MBean の名前。 |
| persistPolicy | String | 次のどれか:OnUpdate|OnTimer|NoMoreOftenThan|OnUnregister|Always|Never。JMX 仕様ドキュメントの「MBean Descriptor Fields」を参照。 |
| persistLocation | String | 完全修飾ディレクトリ名。MBean は、必要に応じてこのディレクトリに保持される。 |
| persistFile | String | MBean を保持するファイルの名前。 |
| persistPeriod | Number | OnTime および NoMoreOftenThan PersistPolicy の永続サイクルの頻度 (秒単位) |
| currencyTimeLimit | Number | キャッシュ値の有効期間。<0 無効、=0 常に有効、>0 秒。 |
| log | String | t:すべての通知をログに記録、f:通知を記録しない。 |
| logfile | String | イベントの記録先ファイルの完全修飾ファイル名。 |
| visibility | Number | 1 - 4 の値のうち 1:常に可視 4:ほとんど不可視。 |
| export | String | この MBean をほかの JMX エージェントにエクスポートまたは公開するとき使用する名前。 |
| presentationString | String | データ表現と MBean を関連付けるための XML 形式の文字列。 |
デフォルトの記述子は、name=className,descriptorType="mbean", displayName=className, persistPolicy="never",log="F",visibility="1" です。記述子にこれらのいずれかのフィールドが不足している場合、不足しているフィールドがデフォルト値で追加されます。
注:以前のバージョンの仕様との不整合があるため、currencyTimeLimit にはゼロ以下の値を使用しないようにしてください。キャッシュに入った値が有効でないことを示す場合は、currencyTimeLimit フィールドを省略します。この値が常に有効であることを示す場合は、このフィールドに非常に大きい値を指定します。
getMBeanDescriptor、インタフェース: ModelMBeanInfoMBeanException - 分散通信 Exception をラップする。ModelMBeanInfo.setMBeanDescriptor(javax.management.Descriptor)public void setMBeanDescriptor(Descriptor inMBeanDescriptor) throws MBeanException, RuntimeOperationsException
ModelMBeanInfogetMBeanDescriptor メソッドの javadoc を参照してください。setMBeanDescriptor、インタフェース: ModelMBeanInfoinMBeanDescriptor - 設定する記述子。MBeanException - 分散通信 Exception をラップする。RuntimeOperationsException - 記述子が無効な場合、IllegalArgumentException をラップする。ModelMBeanInfo.getMBeanDescriptor() バグまたは機能を送信
詳細な API リファレンスおよび開発者ドキュメントについては、Java SE のドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.