AbstractMBeanInfoAssembler superclass to
add a basic algorithm for building metadata based on the
reflective metadata of the MBean class.
The logic for creating MBean metadata from the reflective metadata
is contained in this class, but this class makes no decisions as to
which methods and properties are to be exposed. Instead, it gives
subclasses a chance to 'vote' on each property or method through
the includeXXX methods.
Subclasses are also given the opportunity to populate attribute
and operation metadata with additional descriptors once the metadata
is assembled through the populateXXXDescriptor methods.
includeOperation, includeReadAttribute, includeWriteAttribute, populateAttributeDescriptor, populateOperationDescriptor
| Modifier and Type | Field and Description |
|---|---|
| protected static final int | ATTRIBUTE_OPERATION_VISIBILITY
Lowest visibility, used for operations that correspond to accessors or mutators for attributes. |
| private Integer | defaultCurrencyTimeLimit
Default value for the JMX field "currencyTimeLimit". |
| private boolean | |
| protected static final String | FIELD_CLASS
Constant identifier for the class field in a JMX |
| protected static final String | FIELD_CURRENCY_TIME_LIMIT
Constant identifier for the currency time limit field in a JMX |
| protected static final String | FIELD_DEFAULT
Constant identifier for the default field in a JMX |
| protected static final String | FIELD_DISPLAY_NAME
Constant identifier for the displayName field in a JMX |
| protected static final String | FIELD_GET_METHOD
Identifies a getter method in a JMX |
| protected static final String | FIELD_LOG
Constant identifier for the log field in a JMX |
| protected static final String | FIELD_LOG_FILE
Constant identifier for the logfile field in a JMX |
| protected static final String | FIELD_METRIC_CATEGORY
Constant identifier for the custom metricCategory field in a JMX |
| protected static final String | FIELD_METRIC_TYPE
Constant identifier for the metricType field in a JMX |
| protected static final String | FIELD_PERSIST_LOCATION
Constant identifier for the persistLocation field in a JMX |
| protected static final String | FIELD_PERSIST_NAME
Constant identifier for the persistName field in a JMX |
| protected static final String | FIELD_PERSIST_PERIOD
Constant identifier for the persistPeriod field in a JMX |
| protected static final String | FIELD_PERSIST_POLICY
Constant identifier for the persistPolicy field in a JMX |
| protected static final String | FIELD_ROLE
Constant identifier for the role field in a JMX |
| protected static final String | FIELD_SET_METHOD
Identifies a setter method in a JMX |
| protected static final String | FIELD_UNITS
Constant identifier for the units field in a JMX |
| protected static final String | FIELD_VISIBILITY
Constant identifier for the visibility field in a JMX |
| private ParameterNameDiscoverer | |
| protected static final String | ROLE_GETTER
Constant identifier for the getter role field value in a JMX |
| protected static final String | ROLE_OPERATION
Identifies an operation (method) in a JMX |
| protected static final String | ROLE_SETTER
Constant identifier for the setter role field value in a JMX |
| private boolean | useStrictCasing
Indicates whether strict casing is being used for attributes. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | applyCurrencyTimeLimit(Descriptor
the JMX attribute or operation descriptor desc, int the "currencyTimeLimit" value to apply currencyTimeLimit)Apply the given JMX "currencyTimeLimit" value to the given descriptor. |
| protected final void | applyDefaultCurrencyTimeLimit(Descriptor
the JMX attribute or operation descriptor desc)Set the |
| protected ModelMBeanOperationInfo | Returns: theModelMBeanOperationInfothe method, String Method to create a ModelMBeanOperationInfo forthe logical name for the operation (method name or property name);
not used by the default implementation but possibly by subclasses name, String the key associated with the MBean in the beans map
of the beanKey)MBeanExporterCreates an instance of |
| protected String | Returns: the description for the attributethe PropertyDescriptor for the attribute propertyDescriptor, String the key associated with the MBean in the beans map
of the beanKey)MBeanExporterGet the description for a particular attribute. |
| protected ModelMBeanAttributeInfo[] | Returns: the attribute metadatathe bean instance (might be an AOP proxy) managedBean, String the key associated with the MBean in the beans map
of the beanKey)MBeanExporterImplements abstract org. Iterate through all properties on the MBean class and gives subclasses the chance to vote on the inclusion of both the accessor and mutator. |
| protected Class | Returns: the class to expose in the descriptor field "class"the bean instance (might be an AOP proxy) managedBean)Return the class to be used for the JMX descriptor field "class". |
| protected Integer | |
| protected String | Returns: the description for the operationthe operation method method, String the key associated with the MBean in the beans map
of the beanKey)MBeanExporterGet the description for a particular operation. |
| protected ModelMBeanOperationInfo[] | Returns: the operation metadatathe bean instance (might be an AOP proxy) managedBean, String the key associated with the MBean in the beans map
of the beanKey)MBeanExporterImplements abstract org. Iterate through all methods on the MBean class and gives subclasses the chance to vote on their inclusion. |
| protected MBeanParameterInfo[] | Returns: theMBeanParameterInfo arraythe method, String Method to get the parameter information forthe key associated with the MBean in the beans map
of the beanKey)MBeanExporterCreate parameter info for the given method. |
| protected ParameterNameDiscoverer | getParameterNameDiscoverer()
Return the ParameterNameDiscoverer to use for resolving method parameter
names if needed (may be |
| protected abstract boolean | Returns: whether the operation should be included in the management interfacethe operation method method, String the key associated with the MBean in the beans map
of the beanKey)MBeanExporterAllows subclasses to vote on the inclusion of a particular operation. |
| protected abstract boolean | Returns: true if the accessor should be included in the management interface,
otherwise falsethe accessor method, String Methodthe key associated with the MBean in the beans map
of the beanKey)MBeanExporterAllows subclasses to vote on the inclusion of a particular attribute accessor. |
| protected abstract boolean | Returns: true if the mutator should be included in the management interface,
otherwise falsethe mutator method, String Method.the key associated with the MBean in the beans map
of the beanKey)MBeanExporterAllows subclasses to vote on the inclusion of a particular attribute mutator. |
| protected boolean | isExposeClassDescriptor()
Return whether to expose the JMX descriptor field "class" for managed operations. |
| protected boolean | |
| protected void | populateAttributeDescriptor(Descriptor
the attribute descriptor desc, Method the accessor method for the attribute getter, Method the mutator method for the attribute setter, String the key associated with the MBean in the beans map
of the beanKey)MBeanExporterAllows subclasses to add extra fields to the |
| protected void | populateMBeanDescriptor(Descriptor
the descriptor, Object Descriptor for the MBean resource.the bean instance (might be an AOP proxy) managedBean, String the key associated with the MBean in the beans map
of the beanKey)MBeanExporterOverrides org. Allows subclasses to add extra fields to the |
| protected void | populateOperationDescriptor(Descriptor
the operation descriptor desc, Method the method corresponding to the operation method, String the key associated with the MBean in the beans map
of the beanKey)MBeanExporterAllows subclasses to add extra fields to the |
| public void | setDefaultCurrencyTimeLimit(Integer defaultCurrencyTimeLimit)
Set the default for the JMX field "currencyTimeLimit". |
| public void | setExposeClassDescriptor(boolean exposeClassDescriptor)
Set whether to expose the JMX descriptor field "class" for managed operations. |
| public void | setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDiscoverer)
Set the ParameterNameDiscoverer to use for resolving method parameter names if needed (e.g. for parameter names of MBean operation methods). |
| public void |
| ATTRIBUTE_OPERATION_VISIBILITY | back to summary |
|---|---|
| protected static final int ATTRIBUTE_OPERATION_VISIBILITY Lowest visibility, used for operations that correspond to accessors or mutators for attributes.
| |
| defaultCurrencyTimeLimit | back to summary |
|---|---|
| private Integer defaultCurrencyTimeLimit Default value for the JMX field "currencyTimeLimit". | |
| exposeClassDescriptor | back to summary |
|---|---|
| private boolean exposeClassDescriptor | |
| FIELD_CLASS | back to summary |
|---|---|
| protected static final String FIELD_CLASS Constant identifier for the class field in a JMX | |
| FIELD_CURRENCY_TIME_LIMIT | back to summary |
|---|---|
| protected static final String FIELD_CURRENCY_TIME_LIMIT Constant identifier for the currency time limit field in a JMX | |
| FIELD_DEFAULT | back to summary |
|---|---|
| protected static final String FIELD_DEFAULT Constant identifier for the default field in a JMX | |
| FIELD_DISPLAY_NAME | back to summary |
|---|---|
| protected static final String FIELD_DISPLAY_NAME Constant identifier for the displayName field in a JMX | |
| FIELD_GET_METHOD | back to summary |
|---|---|
| protected static final String FIELD_GET_METHOD Identifies a getter method in a JMX | |
| FIELD_LOG | back to summary |
|---|---|
| protected static final String FIELD_LOG Constant identifier for the log field in a JMX | |
| FIELD_LOG_FILE | back to summary |
|---|---|
| protected static final String FIELD_LOG_FILE Constant identifier for the logfile field in a JMX | |
| FIELD_METRIC_CATEGORY | back to summary |
|---|---|
| protected static final String FIELD_METRIC_CATEGORY Constant identifier for the custom metricCategory field in a JMX | |
| FIELD_METRIC_TYPE | back to summary |
|---|---|
| protected static final String FIELD_METRIC_TYPE Constant identifier for the metricType field in a JMX | |
| FIELD_PERSIST_LOCATION | back to summary |
|---|---|
| protected static final String FIELD_PERSIST_LOCATION Constant identifier for the persistLocation field in a JMX | |
| FIELD_PERSIST_NAME | back to summary |
|---|---|
| protected static final String FIELD_PERSIST_NAME Constant identifier for the persistName field in a JMX | |
| FIELD_PERSIST_PERIOD | back to summary |
|---|---|
| protected static final String FIELD_PERSIST_PERIOD Constant identifier for the persistPeriod field in a JMX | |
| FIELD_PERSIST_POLICY | back to summary |
|---|---|
| protected static final String FIELD_PERSIST_POLICY Constant identifier for the persistPolicy field in a JMX | |
| FIELD_ROLE | back to summary |
|---|---|
| protected static final String FIELD_ROLE Constant identifier for the role field in a JMX | |
| FIELD_SET_METHOD | back to summary |
|---|---|
| protected static final String FIELD_SET_METHOD Identifies a setter method in a JMX | |
| FIELD_UNITS | back to summary |
|---|---|
| protected static final String FIELD_UNITS Constant identifier for the units field in a JMX | |
| FIELD_VISIBILITY | back to summary |
|---|---|
| protected static final String FIELD_VISIBILITY Constant identifier for the visibility field in a JMX | |
| parameterNameDiscoverer | back to summary |
|---|---|
| private ParameterNameDiscoverer parameterNameDiscoverer
| |
| ROLE_GETTER | back to summary |
|---|---|
| protected static final String ROLE_GETTER Constant identifier for the getter role field value in a JMX | |
| ROLE_OPERATION | back to summary |
|---|---|
| protected static final String ROLE_OPERATION Identifies an operation (method) in a JMX | |
| ROLE_SETTER | back to summary |
|---|---|
| protected static final String ROLE_SETTER Constant identifier for the setter role field value in a JMX | |
| useStrictCasing | back to summary |
|---|---|
| private boolean useStrictCasing Indicates whether strict casing is being used for attributes. | |
| AbstractReflectiveMBeanInfoAssembler | back to summary |
|---|---|
| public AbstractReflectiveMBeanInfoAssembler() | |
| applyCurrencyTimeLimit | back to summary |
|---|---|
| protected void applyCurrencyTimeLimit(Descriptor desc, int currencyTimeLimit) Apply the given JMX "currencyTimeLimit" value to the given descriptor. The default implementation sets a value
| |
| applyDefaultCurrencyTimeLimit | back to summary |
|---|---|
| protected final void applyDefaultCurrencyTimeLimit(Descriptor desc) Set the
| |
| createModelMBeanOperationInfo | back to summary |
|---|---|
| protected ModelMBeanOperationInfo createModelMBeanOperationInfo(Method method, String name, String beanKey) Creates an instance of
| |
| getAttributeDescription | back to summary |
|---|---|
| protected String getAttributeDescription(PropertyDescriptor propertyDescriptor, String beanKey) Get the description for a particular attribute. The default implementation returns a description for the operation
that is the name of corresponding
| |
| getAttributeInfo | back to summary |
|---|---|
| protected ModelMBeanAttributeInfo[] getAttributeInfo(Object managedBean, String beanKey) throws JMException Implements abstract org. Iterate through all properties on the MBean class and gives subclasses the chance to vote on the inclusion of both the accessor and mutator. If a particular accessor or mutator is voted for inclusion, the appropriate metadata is assembled and passed to the subclass for descriptor population.
| |
| getClassForDescriptor | back to summary |
|---|---|
| protected Class Return the class to be used for the JMX descriptor field "class". Only applied when the "exposeClassDescriptor" property is "true". The default implementation returns the first implemented interface for a JDK proxy, and the target class else.
| |
| getDefaultCurrencyTimeLimit | back to summary |
|---|---|
| protected Integer getDefaultCurrencyTimeLimit() Return default value for the JMX field "currencyTimeLimit", if any.
| |
| getOperationDescription | back to summary |
|---|---|
| protected String getOperationDescription(Method method, String beanKey) Get the description for a particular operation. The default implementation returns a description for the operation
that is the name of corresponding | |
| getOperationInfo | back to summary |
|---|---|
| protected ModelMBeanOperationInfo[] getOperationInfo(Object managedBean, String beanKey) Implements abstract org. Iterate through all methods on the MBean class and gives subclasses the chance to vote on their inclusion. If a particular method corresponds to the accessor or mutator of an attribute that is included in the management interface, then the corresponding operation is exposed with the "role" descriptor field set to the appropriate value.
| |
| getOperationParameters | back to summary |
|---|---|
| protected MBeanParameterInfo[] getOperationParameters(Method method, String beanKey) Create parameter info for the given method. The default implementation returns an empty array of
| |
| getParameterNameDiscoverer | back to summary |
|---|---|
| protected ParameterNameDiscoverer getParameterNameDiscoverer() Return the ParameterNameDiscoverer to use for resolving method parameter
names if needed (may be
| |
| includeOperation | back to summary |
|---|---|
| protected abstract boolean includeOperation(Method method, String beanKey) Allows subclasses to vote on the inclusion of a particular operation. | |
| includeReadAttribute | back to summary |
|---|---|
| protected abstract boolean includeReadAttribute(Method method, String beanKey) Allows subclasses to vote on the inclusion of a particular attribute accessor. | |
| includeWriteAttribute | back to summary |
|---|---|
| protected abstract boolean includeWriteAttribute(Method method, String beanKey) Allows subclasses to vote on the inclusion of a particular attribute mutator. | |
| isExposeClassDescriptor | back to summary |
|---|---|
| protected boolean isExposeClassDescriptor() Return whether to expose the JMX descriptor field "class" for managed operations. | |
| isUseStrictCasing | back to summary |
|---|---|
| protected boolean isUseStrictCasing() Return whether strict casing for attributes is enabled. | |
| populateAttributeDescriptor | back to summary |
|---|---|
| protected void populateAttributeDescriptor(Descriptor desc, Method getter, Method setter, String beanKey) Allows subclasses to add extra fields to the The default implementation sets the
| |
| populateMBeanDescriptor | back to summary |
|---|---|
| protected void populateMBeanDescriptor(Descriptor descriptor, Object managedBean, String beanKey) Overrides org. Allows subclasses to add extra fields to the The default implementation sets the
| |
| populateOperationDescriptor | back to summary |
|---|---|
| protected void populateOperationDescriptor(Descriptor desc, Method method, String beanKey) Allows subclasses to add extra fields to the The default implementation sets the
| |
| setDefaultCurrencyTimeLimit | back to summary |
|---|---|
| public void setDefaultCurrencyTimeLimit(Integer defaultCurrencyTimeLimit) Set the default for the JMX field "currencyTimeLimit". The default will usually indicate to never cache attribute values. Default is none, not explicitly setting that field, as recommended by the
JMX 1.2 specification. This should result in "never cache" behavior, always
reading attribute values freshly (which corresponds to a "currencyTimeLimit"
of However, some JMX implementations (that do not follow the JMX 1.2 spec in that respect) might require an explicit value to be set here to get "never cache" behavior: for example, JBoss 3.2.x. Note that the "currencyTimeLimit" value can also be specified on a
managed attribute or operation. The default value will apply if not
overridden with a "currencyTimeLimit" value | |
| setExposeClassDescriptor | back to summary |
|---|---|
| public void setExposeClassDescriptor(boolean exposeClassDescriptor) Set whether to expose the JMX descriptor field "class" for managed operations. Default is "false", letting the JMX implementation determine the actual class through reflection. Set this property to Warning Review your proxy definitions when exposing a JDK dynamic
proxy through JMX, in particular with this property turned to
| |
| setParameterNameDiscoverer | back to summary |
|---|---|
| public void setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDiscoverer) Set the ParameterNameDiscoverer to use for resolving method parameter names if needed (e.g. for parameter names of MBean operation methods). Default is a | |
| setUseStrictCasing | back to summary |
|---|---|
| public void setUseStrictCasing(boolean useStrictCasing) Set whether to use strict casing for attributes. Enabled by default. When using strict casing, a JavaBean property with a getter such as
| |