public abstract class AbstractReflectiveMBeanInfoAssembler extends AbstractMBeanInfoAssembler
AbstractMBeanInfoAssembler スーパークラスに基づいて構築し、MBean クラスのリフレクトメタデータに基づいてメタデータを構築するための基本的なアルゴリズムを追加します。 リフレクティブメタデータから MBean メタデータを作成するためのロジックはこのクラスに含まれていますが、このクラスはどのメソッドとプロパティを公開するかを決定しません。代わりに、includeXXX メソッドを介して各プロパティまたはメソッドに「投票」する機会をサブクラスに与えます。
サブクラスには、メタデータが populateXXXDescriptor メソッドを介してアセンブルされると、属性と操作のメタデータに追加の記述子を追加する機会も与えられます。
includeOperation(java.lang.reflect.Method, java.lang.String), includeReadAttribute(java.lang.reflect.Method, java.lang.String), includeWriteAttribute(java.lang.reflect.Method, java.lang.String), populateAttributeDescriptor(javax.management.Descriptor, java.lang.reflect.Method, java.lang.reflect.Method, java.lang.String), populateOperationDescriptor(javax.management.Descriptor, java.lang.reflect.Method, java.lang.String)| 修飾子と型 | フィールドと説明 |
|---|---|
protected static int | ATTRIBUTE_OPERATION_VISIBILITY 最も低い可視性。属性のアクセサーまたはミューテーターに対応する操作に使用されます。 |
protected static StringSE | FIELD_CLASSJMX DescriptorSE のクラスフィールドの定数識別子。 |
protected static StringSE | FIELD_CURRENCY_TIME_LIMITJMX DescriptorSE の通貨期限フィールドの定数識別子。 |
protected static StringSE | FIELD_DEFAULTJMX DescriptorSE のデフォルトフィールドの定数識別子。 |
protected static StringSE | FIELD_DISPLAY_NAMEJMX DescriptorSE 内の displayName フィールドの定数識別子。 |
protected static StringSE | FIELD_GET_METHODJMX DescriptorSE の getter メソッドを識別します。 |
protected static StringSE | FIELD_LOGJMX DescriptorSE のログフィールドの定数識別子。 |
protected static StringSE | FIELD_LOG_FILEJMX DescriptorSE のログファイルフィールドの定数識別子。 |
protected static StringSE | FIELD_METRIC_CATEGORYJMX DescriptorSE 内のカスタム metricCategory フィールドの定数識別子。 |
protected static StringSE | FIELD_METRIC_TYPEJMX DescriptorSE 内の metricType フィールドの定数識別子。 |
protected static StringSE | FIELD_PERSIST_LOCATIONJMX DescriptorSE 内の persistLocation フィールドの定数識別子。 |
protected static StringSE | FIELD_PERSIST_NAMEJMX DescriptorSE 内の persistName フィールドの定数識別子。 |
protected static StringSE | FIELD_PERSIST_PERIODJMX DescriptorSE 内の persistPeriod フィールドの定数識別子。 |
protected static StringSE | FIELD_PERSIST_POLICYJMX DescriptorSE 内の persistPolicy フィールドの定数識別子。 |
protected static StringSE | FIELD_ROLEJMX DescriptorSE のロールフィールドの定数識別子。 |
protected static StringSE | FIELD_SET_METHODJMX DescriptorSE の setter メソッドを識別します。 |
protected static StringSE | FIELD_UNITSJMX DescriptorSE の単位フィールドの定数識別子。 |
protected static StringSE | FIELD_VISIBILITYJMX DescriptorSE の可視性フィールドの定数識別子。 |
protected static StringSE | ROLE_GETTERJMX DescriptorSE の getter ロールフィールド値の定数識別子。 |
protected static StringSE | ROLE_OPERATIONJMX DescriptorSE の操作(メソッド)を識別します。 |
protected static StringSE | ROLE_SETTERJMX DescriptorSE の setter ロールフィールド値の定数識別子。 |
| コンストラクターと説明 |
|---|
AbstractReflectiveMBeanInfoAssembler() |
| 修飾子と型 | メソッドと説明 |
|---|---|
protected void | applyCurrencyTimeLimit(DescriptorSE desc, int currencyTimeLimit) 指定された JMX "currencyTimeLimit" 値を指定された記述子に適用します。 |
protected void | applyDefaultCurrencyTimeLimit(DescriptorSE desc) 指定された "defaultCurrencyTimeLimit" がある場合は、 currencyTimeLimit フィールドをその値に設定します (デフォルトではなし)。 |
protected ModelMBeanOperationInfoSE | createModelMBeanOperationInfo(MethodSE method, StringSE name, StringSE beanKey) 指定されたメソッドの ModelMBeanOperationInfo のインスタンスを作成します。 |
protected StringSE | getAttributeDescription(PropertyDescriptorSE propertyDescriptor, StringSE beanKey) 特定の属性の説明を取得します。 |
protected ModelMBeanAttributeInfoSE[] | getAttributeInfo(ObjectSE managedBean, StringSE beanKey)MBean クラスのすべてのプロパティを反復処理し、サブクラスにアクセサーとミューテーターの両方を含めることについて投票する機会を与えます。 |
protected ClassSE<?> | getClassForDescriptor(ObjectSE managedBean)JMX 記述子フィールド「クラス」に使用されるクラスを返します。 |
protected IntegerSE | getDefaultCurrencyTimeLimit()JMX フィールド "currencyTimeLimit" のデフォルト値を返します (存在する場合)。 |
protected StringSE | getOperationDescription(MethodSE method, StringSE beanKey) 特定の操作の説明を取得します。 |
protected ModelMBeanOperationInfoSE[] | getOperationInfo(ObjectSE managedBean, StringSE beanKey)MBean クラスのすべてのメソッドを反復処理し、サブクラスにそれらの包含に投票する機会を与えます。 |
protected MBeanParameterInfoSE[] | getOperationParameters(MethodSE method, StringSE beanKey) 指定されたメソッドのパラメーター情報を作成します。 |
protected ParameterNameDiscoverer | getParameterNameDiscoverer() 必要に応じてメソッドのパラメーター名を解決するために使用する ParameterNameDiscoverer を返します(パラメーターの検出をスキップするために null の場合があります)。 |
protected abstract boolean | includeOperation(MethodSE method, StringSE beanKey) サブクラスが特定の操作の包含について投票できるようにします。 |
protected abstract boolean | includeReadAttribute(MethodSE method, StringSE beanKey) サブクラスが特定の属性アクセサーの包含について投票できるようにします。 |
protected abstract boolean | includeWriteAttribute(MethodSE method, StringSE beanKey) サブクラスが特定の属性ミューテーターの包含について投票できるようにします。 |
protected boolean | isExposeClassDescriptor() 管理された操作の JMX 記述子フィールド「クラス」を公開するかどうかを返します。 |
protected boolean | isUseStrictCasing() 属性の厳密な大文字小文字の区別が有効かどうかを返します。 |
protected void | populateAttributeDescriptor(DescriptorSE desc, MethodSE getter, MethodSE setter, StringSE beanKey) サブクラスが特定の属性の Descriptor にフィールドを追加できるようにします。 |
protected void | populateMBeanDescriptor(DescriptorSE descriptor, ObjectSE managedBean, StringSE beanKey) サブクラスが MBean の Descriptor にフィールドを追加できるようにします。 |
protected void | populateOperationDescriptor(DescriptorSE desc, MethodSE method, StringSE beanKey) サブクラスが特定の操作のために Descriptor にフィールドを追加できるようにします。 |
void | setDefaultCurrencyTimeLimit(IntegerSE defaultCurrencyTimeLimit)JMX フィールド "currencyTimeLimit" のデフォルトを設定します。 |
void | setExposeClassDescriptor(boolean exposeClassDescriptor) 管理対象オペレーションの JMX 記述子フィールド「クラス」を公開するかどうかを設定します。 |
void | setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDiscoverer) 必要に応じて、メソッドパラメーター名の解決に使用する ParameterNameDiscoverer を設定します(例: |
void | setUseStrictCasing(boolean useStrictCasing) 属性に厳密な大文字小文字を使用するかどうかを設定します。 |
checkManagedBean, getClassName, getClassToExpose, getClassToExpose, getConstructorInfo, getDescription, getMBeanInfo, getNotificationInfo, getTargetClasscloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEprotected static final StringSE FIELD_GET_METHOD
DescriptorSE の getter メソッドを識別します。protected static final StringSE FIELD_SET_METHOD
DescriptorSE の setter メソッドを識別します。protected static final StringSE FIELD_ROLE
DescriptorSE のロールフィールドの定数識別子。protected static final StringSE ROLE_GETTER
DescriptorSE の getter ロールフィールド値の定数識別子。protected static final StringSE ROLE_SETTER
DescriptorSE の setter ロールフィールド値の定数識別子。protected static final StringSE ROLE_OPERATION
DescriptorSE の操作(メソッド)を識別します。protected static final StringSE FIELD_VISIBILITY
DescriptorSE の可視性フィールドの定数識別子。protected static final int ATTRIBUTE_OPERATION_VISIBILITY
FIELD_VISIBILITY, 定数フィールド値 protected static final StringSE FIELD_CLASS
DescriptorSE のクラスフィールドの定数識別子。protected static final StringSE FIELD_LOG
DescriptorSE のログフィールドの定数識別子。protected static final StringSE FIELD_LOG_FILE
DescriptorSE のログファイルフィールドの定数識別子。protected static final StringSE FIELD_CURRENCY_TIME_LIMIT
DescriptorSE の通貨期限フィールドの定数識別子。protected static final StringSE FIELD_DEFAULT
DescriptorSE のデフォルトフィールドの定数識別子。protected static final StringSE FIELD_PERSIST_POLICY
DescriptorSE 内の persistPolicy フィールドの定数識別子。protected static final StringSE FIELD_PERSIST_PERIOD
DescriptorSE 内の persistPeriod フィールドの定数識別子。protected static final StringSE FIELD_PERSIST_LOCATION
DescriptorSE 内の persistLocation フィールドの定数識別子。protected static final StringSE FIELD_PERSIST_NAME
DescriptorSE 内の persistName フィールドの定数識別子。protected static final StringSE FIELD_DISPLAY_NAME
DescriptorSE 内の displayName フィールドの定数識別子。protected static final StringSE FIELD_UNITS
DescriptorSE の単位フィールドの定数識別子。protected static final StringSE FIELD_METRIC_TYPE
DescriptorSE 内の metricType フィールドの定数識別子。protected static final StringSE FIELD_METRIC_CATEGORY
DescriptorSE 内のカスタム metricCategory フィールドの定数識別子。public void setDefaultCurrencyTimeLimit(@Nullable IntegerSE defaultCurrencyTimeLimit)
デフォルトは none で、JMX 1.2 仕様で推奨されているように、そのフィールドを明示的に設定しません。これにより、「キャッシュしない」動作になり、常に属性値が新しく読み取られます (これは、JMX 1.2 の -1 の "currencyTimeLimit" に相当します)。
ただし、一部の JMX 実装(その点で JMX 1.2 仕様に準拠していない)では、「キャッシュしない」動作を取得するために、ここで明示的な値を設定する必要がある場合があります(JBoss 3.2.x など)。
"currencyTimeLimit" 値は、管理対象属性または操作にも指定できることに注意してください。そこで "currencyTimeLimit" 値 >= 0 で上書きされない場合は、デフォルト値が適用されます。メタデータ "currencyTimeLimit" 値 -1 は、デフォルトを使用することを示します。値 0 は「常にキャッシュする」ことを示し、Integer.MAX_VALUE に変換されます。正の値は、キャッシュの秒数を示します。
@Nullable protected IntegerSE getDefaultCurrencyTimeLimit()
public void setUseStrictCasing(boolean useStrictCasing)
厳密な大文字小文字を使用する場合、getFoo() などの getter を持つ JavaBean プロパティは、Foo と呼ばれる属性に変換されます。厳密なケーシングを無効にすると、getFoo() は foo に変換されます。
protected boolean isUseStrictCasing()
public void setExposeClassDescriptor(boolean exposeClassDescriptor)
「クラス」フィールドを指定する必要がある JMX 実装の場合、このプロパティを true に設定します(例: WebLogic)。その場合、プレーンな Bean インスタンスまたは CGLIB プロキシの場合、Spring はそこでターゲットクラス名を公開します。JDK 動的プロキシに遭遇すると、プロキシによって実装される最初のインターフェースが指定されます。
警告 : JMX を介して JDK 動的プロキシを公開する場合、特にこのプロパティが true になっている場合は、プロキシ定義を確認してください。: この場合、指定されたインターフェースリストは管理インターフェースで始まり、他のすべてのインターフェースがそれに続きます。一般に、ターゲット Bean を直接公開するか、代わりに CGLIB プロキシを公開することを検討してください。
protected boolean isExposeClassDescriptor()
public void setParameterNameDiscoverer(@Nullable ParameterNameDiscoverer parameterNameDiscoverer)
デフォルトは DefaultParameterNameDiscoverer です。
@Nullable protected ParameterNameDiscoverer getParameterNameDiscoverer()
null の場合があります)。protected ModelMBeanAttributeInfoSE[] getAttributeInfo(ObjectSE managedBean, StringSE beanKey) throws JMExceptionSE
AbstractMBeanInfoAssembler の getAttributeInfo managedBean - Bean インスタンス (AOP プロキシである可能性があります)beanKey - MBeanExporter の Bean マップで MBean に関連付けられているキー JMExceptionSE - エラーの場合 populateAttributeDescriptor(javax.management.Descriptor, java.lang.reflect.Method, java.lang.reflect.Method, java.lang.String)protected ModelMBeanOperationInfoSE[] getOperationInfo(ObjectSE managedBean, StringSE beanKey)
AbstractMBeanInfoAssembler の getOperationInfo managedBean - Bean インスタンス (AOP プロキシである可能性があります)beanKey - MBeanExporter の Bean マップで MBean に関連付けられているキー populateOperationDescriptor(javax.management.Descriptor, java.lang.reflect.Method, java.lang.String)protected ModelMBeanOperationInfoSE createModelMBeanOperationInfo(MethodSE method, StringSE name, StringSE beanKey)
ModelMBeanOperationInfo のインスタンスを作成します。操作のパラメーター情報を入力します。method - ModelMBeanOperationInfo を作成するための Method name - 操作の論理名(メソッド名またはプロパティ名)。デフォルトの実装では使用されませんが、サブクラスで使用される可能性があります beanKey - MBeanExporter の Bean マップで MBean に関連付けられているキー ModelMBeanOperationInfoprotected ClassSE<?> getClassForDescriptor(ObjectSE managedBean)
デフォルトの実装は、JDK プロキシ用に最初に実装されたインターフェースと、それ以外のターゲットクラスを返します。
managedBean - Bean インスタンス (AOP プロキシである可能性があります)setExposeClassDescriptor(boolean), AbstractMBeanInfoAssembler.getClassToExpose(Class), AopProxyUtils.proxiedUserInterfaces(Object)protected abstract boolean includeReadAttribute(MethodSE method, StringSE beanKey)
method - アクセサー MethodbeanKey - MBeanExporter の Bean マップで MBean に関連付けられているキー true、それ以外の場合は falseprotected abstract boolean includeWriteAttribute(MethodSE method, StringSE beanKey)
method - ミューテータ Method。beanKey - MBeanExporter の Bean マップで MBean に関連付けられているキー true、それ以外の場合は falseprotected abstract boolean includeOperation(MethodSE method, StringSE beanKey)
method - 操作方法 beanKey - MBeanExporter の Bean マップで MBean に関連付けられているキー protected StringSE getAttributeDescription(PropertyDescriptorSE propertyDescriptor, StringSE beanKey)
デフォルトの実装は、対応する Method の名前である操作の説明を返します。
propertyDescriptor - 属性の PropertyDescriptorbeanKey - MBeanExporter の Bean マップで MBean に関連付けられているキー protected StringSE getOperationDescription(MethodSE method, StringSE beanKey)
デフォルトの実装は、対応する Method の名前である操作の説明を返します。
method - 操作方法 beanKey - MBeanExporter の Bean マップで MBean に関連付けられているキー protected MBeanParameterInfoSE[] getOperationParameters(MethodSE method, StringSE beanKey)
デフォルトの実装は、MBeanParameterInfo の空の配列を返します。
method - パラメーター情報を取得する Method beanKey - MBeanExporter の Bean マップで MBean に関連付けられているキー MBeanParameterInfo 配列 protected void populateMBeanDescriptor(DescriptorSE descriptor, ObjectSE managedBean, StringSE beanKey)
Descriptor にフィールドを追加できるようにします。 デフォルトの実装では、指定された "defaultCurrencyTimeLimit" が存在する場合(デフォルトではなし)、currencyTimeLimit フィールドがそれに設定されます。
AbstractMBeanInfoAssembler の populateMBeanDescriptor descriptor - MBean リソースの Descriptor。managedBean - Bean インスタンス (AOP プロキシである可能性があります)beanKey - MBeanExporter の Bean マップで MBean に関連付けられているキー setDefaultCurrencyTimeLimit(Integer), applyDefaultCurrencyTimeLimit(javax.management.Descriptor)protected void populateAttributeDescriptor(DescriptorSE desc, @Nullable MethodSE getter, @Nullable MethodSE setter, StringSE beanKey)
Descriptor にフィールドを追加できるようにします。 デフォルトの実装では、指定された "defaultCurrencyTimeLimit" が存在する場合(デフォルトではなし)、currencyTimeLimit フィールドがそれに設定されます。
desc - 属性記述子 getter - 属性のアクセサーメソッド setter - 属性のミューテーターメソッド beanKey - MBeanExporter の Bean マップで MBean に関連付けられているキー setDefaultCurrencyTimeLimit(Integer), applyDefaultCurrencyTimeLimit(javax.management.Descriptor)protected void populateOperationDescriptor(DescriptorSE desc, MethodSE method, StringSE beanKey)
Descriptor にフィールドを追加できるようにします。 デフォルトの実装では、指定された "defaultCurrencyTimeLimit" が存在する場合(デフォルトではなし)、currencyTimeLimit フィールドがそれに設定されます。
desc - 操作記述子 method - 操作に対応するメソッド beanKey - MBeanExporter の Bean マップで MBean に関連付けられているキー setDefaultCurrencyTimeLimit(Integer), applyDefaultCurrencyTimeLimit(javax.management.Descriptor)protected final void applyDefaultCurrencyTimeLimit(DescriptorSE desc)
currencyTimeLimit フィールドをその値に設定します (デフォルトではなし)。desc - JMX 属性または操作記述子 setDefaultCurrencyTimeLimit(Integer)protected void applyCurrencyTimeLimit(DescriptorSE desc, int currencyTimeLimit)
デフォルトの実装では、値 >0 をそのまま (キャッシュ秒数として) 設定し、値 0 を Integer.MAX_VALUE (「常にキャッシュ」) に変換し、値 <0 の場合は "defaultCurrencyTimeLimit" (存在する場合は「キャッシュしない」を示す) を設定します。これは、JMX 1.2 仕様の推奨事項に従います。
desc - JMX 属性または操作記述子 currencyTimeLimit - 適用する "currencyTimeLimit" 値 setDefaultCurrencyTimeLimit(Integer), applyDefaultCurrencyTimeLimit(javax.management.Descriptor)