public class ModelMBeanInfoSupport extends MBeanInfo implements ModelMBeanInfo
管理対象になるJavaリソースは、MBeanServerのcreateMBeanメソッドを使って、ModelMBeanをインスタンス化します。次に、ModelMBeanインスタンスのModelMBeanInfoとDescriptorを設定します。ModelMBeanのModelMBeanInfoで公開された属性とオペレーションには、MBean、コネクタ、アダプタからアクセスできます。Descriptorを使って、管理対象アプリケーション内の値とメソッドを定義し、ModelMBeanの属性およびオペレーションにマップすることができます。このマッピングは、ファイルを使った開発時、または実行時にプログラムを使って動的に定義できます。
ModelMBean内でインスタンス化される各ModelMBeanが管理対象になります。これらの属性およびオペレーションには、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, 2014, Oracle and/or its affiliates. All rights reserved.