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_CLASS JMX Descriptor SE のクラスフィールドの定数識別子。 |
protected static StringSE | FIELD_CURRENCY_TIME_LIMIT JMX Descriptor SE の通貨期限フィールドの定数識別子。 |
protected static StringSE | FIELD_DEFAULT JMX Descriptor SE のデフォルトフィールドの定数識別子。 |
protected static StringSE | FIELD_DISPLAY_NAME JMX Descriptor SE の displayName フィールドの定数識別子。 |
protected static StringSE | FIELD_GET_METHOD JMX Descriptor SE の getter メソッドを識別します。 |
protected static StringSE | FIELD_LOG JMX Descriptor SE のログフィールドの定数識別子。 |
protected static StringSE | FIELD_LOG_FILE JMX Descriptor SE のログファイルフィールドの定数識別子。 |
protected static StringSE | FIELD_METRIC_CATEGORY JMX Descriptor SE のカスタム metricCategory フィールドの定数識別子。 |
protected static StringSE | FIELD_METRIC_TYPE JMX Descriptor SE の metricType フィールドの定数識別子。 |
protected static StringSE | FIELD_PERSIST_LOCATION JMX Descriptor SE の persistLocation フィールドの定数識別子。 |
protected static StringSE | FIELD_PERSIST_NAME JMX Descriptor SE の persistName フィールドの定数識別子。 |
protected static StringSE | FIELD_PERSIST_PERIOD JMX Descriptor SE の persistPeriod フィールドの定数識別子。 |
protected static StringSE | FIELD_PERSIST_POLICY JMX Descriptor SE の persistPolicy フィールドの定数識別子。 |
protected static StringSE | FIELD_ROLE JMX Descriptor SE のロールフィールドの定数識別子。 |
protected static StringSE | FIELD_SET_METHOD JMX Descriptor SE の setter メソッドを識別します。 |
protected static StringSE | FIELD_UNITS JMX Descriptor SE の単位フィールドの定数識別子。 |
protected static StringSE | FIELD_VISIBILITY JMX Descriptor SE の可視性フィールドの定数識別子。 |
protected static StringSE | ROLE_GETTER JMX Descriptor SE の getter ロールフィールド値の定数識別子。 |
protected static StringSE | ROLE_OPERATION JMX Descriptor SE の操作(メソッド)を識別します。 |
protected static StringSE | ROLE_SETTER JMX Descriptor SE の setter ロールフィールド値の定数識別子。 |
コンストラクターと説明 |
---|
AbstractReflectiveMBeanInfoAssembler() |
修飾子と型 | メソッドと説明 |
---|---|
protected void | applyCurrencyTimeLimit(DescriptorSE desc, int currencyTimeLimit) 指定された JMX の "currencyTimeLimit" 値を指定された記述子に適用します。 |
protected void | applyDefaultCurrencyTimeLimit(DescriptorSE desc) currencyTimeLimit フィールドを指定された "defaultCurrencyTimeLimit" に設定します(ある場合)(デフォルトではなし)。 |
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, getTargetClass
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
protected static final StringSE FIELD_GET_METHOD
Descriptor
SE の getter メソッドを識別します。protected static final StringSE FIELD_SET_METHOD
Descriptor
SE の setter メソッドを識別します。protected static final StringSE FIELD_ROLE
Descriptor
SE のロールフィールドの定数識別子。protected static final StringSE ROLE_GETTER
Descriptor
SE の getter ロールフィールド値の定数識別子。protected static final StringSE ROLE_SETTER
Descriptor
SE の setter ロールフィールド値の定数識別子。protected static final StringSE ROLE_OPERATION
Descriptor
SE の操作(メソッド)を識別します。protected static final StringSE FIELD_VISIBILITY
Descriptor
SE の可視性フィールドの定数識別子。protected static final int ATTRIBUTE_OPERATION_VISIBILITY
FIELD_VISIBILITY
, 定数フィールド値 protected static final StringSE FIELD_CLASS
Descriptor
SE のクラスフィールドの定数識別子。protected static final StringSE FIELD_LOG
Descriptor
SE のログフィールドの定数識別子。protected static final StringSE FIELD_LOG_FILE
Descriptor
SE のログファイルフィールドの定数識別子。protected static final StringSE FIELD_CURRENCY_TIME_LIMIT
Descriptor
SE の通貨期限フィールドの定数識別子。protected static final StringSE FIELD_DEFAULT
Descriptor
SE のデフォルトフィールドの定数識別子。protected static final StringSE FIELD_PERSIST_POLICY
Descriptor
SE の persistPolicy フィールドの定数識別子。protected static final StringSE FIELD_PERSIST_PERIOD
Descriptor
SE の persistPeriod フィールドの定数識別子。protected static final StringSE FIELD_PERSIST_LOCATION
Descriptor
SE の persistLocation フィールドの定数識別子。protected static final StringSE FIELD_PERSIST_NAME
Descriptor
SE の persistName フィールドの定数識別子。protected static final StringSE FIELD_DISPLAY_NAME
Descriptor
SE の displayName フィールドの定数識別子。protected static final StringSE FIELD_UNITS
Descriptor
SE の単位フィールドの定数識別子。protected static final StringSE FIELD_METRIC_TYPE
Descriptor
SE の metricType フィールドの定数識別子。protected static final StringSE FIELD_METRIC_CATEGORY
Descriptor
SE のカスタム 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
でオーバーライドされない場合、デフォルト値が適用されます。-1
のメタデータ "currencyTimeLimit" 値は、デフォルトを使用することを示します。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 に関連付けられているキー ModelMBeanOperationInfo
protected 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
- アクセサー Method
beanKey
- MBeanExporter
の Bean マップで MBean に関連付けられているキー true
、それ以外の場合は false
protected abstract boolean includeWriteAttribute(MethodSE method, StringSE beanKey)
method
- ミューテータ Method
。beanKey
- MBeanExporter
の Bean マップで MBean に関連付けられているキー true
、それ以外の場合は false
protected 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
にフィールドを追加できるようにします。 デフォルトの実装では、currencyTimeLimit
フィールドが指定された "defaultCurrencyTimeLimit" に設定されます(デフォルトではなし)。
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
にフィールドを追加できるようにします。 デフォルトの実装では、currencyTimeLimit
フィールドが指定された "defaultCurrencyTimeLimit" に設定されます(デフォルトではなし)。
desc
- 属性記述子 getter
- 属性のアクセサーメソッド setter
- 属性のミューテーターメソッド beanKey
- MBeanExporter
の Bean マップで MBean に関連付けられているキー setDefaultCurrencyTimeLimit(Integer)
, applyDefaultCurrencyTimeLimit(javax.management.Descriptor)
protected void populateOperationDescriptor(DescriptorSE desc, MethodSE method, StringSE beanKey)
Descriptor
にフィールドを追加できるようにします。 デフォルトの実装では、currencyTimeLimit
フィールドが指定された "defaultCurrencyTimeLimit" に設定されます(デフォルトではなし)。
desc
- 操作記述子 method
- 操作に対応するメソッド beanKey
- MBeanExporter
の Bean マップで MBean に関連付けられているキー setDefaultCurrencyTimeLimit(Integer)
, applyDefaultCurrencyTimeLimit(javax.management.Descriptor)
protected final void applyDefaultCurrencyTimeLimit(DescriptorSE desc)
currencyTimeLimit
フィールドを指定された "defaultCurrencyTimeLimit" に設定します(ある場合)(デフォルトではなし)。desc
- JMX 属性または操作記述子 setDefaultCurrencyTimeLimit(Integer)
protected void applyCurrencyTimeLimit(DescriptorSE desc, int currencyTimeLimit)
デフォルトの実装では、値 >0
をそのまま(キャッシュ秒数として)設定し、0
の値を Integer.MAX_VALUE
(「常にキャッシュ」)に変換し、"defaultCurrencyTimeLimit" (存在する場合は「キャッシュしない」を示す)を設定します。値 <0
. これは、JMX 1.2 仕様の推奨事項に従います。
desc
- JMX 属性または操作記述子 currencyTimeLimit
- 適用する "currencyTimeLimit" 値 setDefaultCurrencyTimeLimit(Integer)
, applyDefaultCurrencyTimeLimit(javax.management.Descriptor)