public class AnnotationMBeanInfoAssembler
extends org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
InterfaceBasedMBeanInfoAssembler
and MetadataMBeanInfoAssembler
.
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
FIELD_RUN_ASYNC |
protected static java.lang.String |
FIELD_TIMEOUT |
ATTRIBUTE_OPERATION_VISIBILITY, FIELD_CLASS, FIELD_CURRENCY_TIME_LIMIT, FIELD_DEFAULT, FIELD_DISPLAY_NAME, FIELD_GET_METHOD, FIELD_LOG, FIELD_LOG_FILE, FIELD_METRIC_CATEGORY, FIELD_METRIC_TYPE, FIELD_PERSIST_LOCATION, FIELD_PERSIST_NAME, FIELD_PERSIST_PERIOD, FIELD_PERSIST_POLICY, FIELD_ROLE, FIELD_SET_METHOD, FIELD_UNITS, FIELD_VISIBILITY, ROLE_GETTER, ROLE_OPERATION, ROLE_SETTER
Constructor and Description |
---|
AnnotationMBeanInfoAssembler() |
Modifier and Type | Method and Description |
---|---|
protected void |
applyRunAsync(javax.management.Descriptor desc,
java.lang.reflect.Method operation)
Adds fields to the operation descriptor in case of operation should be executed asynchronously if
operation was annotated by JmxRunAsync . |
protected java.lang.String |
getAttributeDescription(java.beans.PropertyDescriptor propertyDescriptor,
java.lang.String beanKey)
Creates a description for the attribute corresponding to this property
descriptor.
|
protected java.lang.String |
getDescription(java.lang.Object managedBean,
java.lang.String beanKey)
Reads managed resource description from the source level metadata.
|
protected javax.management.modelmbean.ModelMBeanNotificationInfo[] |
getNotificationInfo(java.lang.Object managedBean,
java.lang.String beanKey)
Reads the
ManagedNotification metadata from the Class of the managed resource
and generates and returns the corresponding ModelMBeanNotificationInfo metadata. |
protected java.lang.String |
getOperationDescription(java.lang.reflect.Method method,
java.lang.String beanKey)
Retrieves the description for the supplied
Method from the
metadata. |
protected javax.management.MBeanParameterInfo[] |
getOperationParameters(java.lang.reflect.Method method,
java.lang.String beanKey)
Reads
MBeanParameterInfo from the ManagedOperationParameter
attributes attached to a method. |
protected boolean |
includeOperation(java.lang.reflect.Method method,
java.lang.String beanKey)
Votes on the inclusion of an operation.
|
protected boolean |
includeReadAttribute(java.lang.reflect.Method method,
java.lang.String beanKey)
Vote on the inclusion of an attribute accessor.
|
protected boolean |
includeWriteAttribute(java.lang.reflect.Method method,
java.lang.String beanKey)
Votes on the inclusion of an attribute mutator.
|
protected void |
populateAttributeDescriptor(javax.management.Descriptor desc,
java.lang.reflect.Method getter,
java.lang.reflect.Method setter,
java.lang.String beanKey)
Adds descriptor fields from the
ManagedAttribute attribute or the ManagedMetric attribute
to the attribute descriptor. |
protected void |
populateMBeanDescriptor(javax.management.Descriptor desc,
java.lang.Object managedBean,
java.lang.String beanKey)
Adds descriptor fields from the
ManagedResource attribute
to the MBean descriptor. |
protected void |
populateOperationDescriptor(javax.management.Descriptor desc,
java.lang.reflect.Method method,
java.lang.String beanKey)
Adds descriptor fields from the
ManagedAttribute attribute to the attribute descriptor. |
void |
setAttributeSource(org.springframework.jmx.export.metadata.JmxAttributeSource attributeSource) |
applyCurrencyTimeLimit, applyDefaultCurrencyTimeLimit, createModelMBeanOperationInfo, getAttributeInfo, getClassForDescriptor, getDefaultCurrencyTimeLimit, getOperationInfo, getParameterNameDiscoverer, isExposeClassDescriptor, isUseStrictCasing, setDefaultCurrencyTimeLimit, setExposeClassDescriptor, setParameterNameDiscoverer, setUseStrictCasing
protected static final java.lang.String FIELD_RUN_ASYNC
protected static final java.lang.String FIELD_TIMEOUT
public void setAttributeSource(org.springframework.jmx.export.metadata.JmxAttributeSource attributeSource)
protected boolean includeReadAttribute(@Nonnull java.lang.reflect.Method method, @Nonnull java.lang.String beanKey)
includeReadAttribute
in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
method
- the accessor methodbeanKey
- the key associated with the MBean in the beans mapprotected boolean includeWriteAttribute(@Nonnull java.lang.reflect.Method method, @Nonnull java.lang.String beanKey)
includeWriteAttribute
in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
method
- the mutator methodbeanKey
- the key associated with the MBean in the beans mapprotected boolean includeOperation(@Nonnull java.lang.reflect.Method method, @Nonnull java.lang.String beanKey)
includeOperation
in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
method
- the operation methodbeanKey
- the key associated with the MBean in the beans map@Nonnull protected java.lang.String getDescription(@Nonnull java.lang.Object managedBean, java.lang.String beanKey)
String
if no description can be found.getDescription
in class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
@Nonnull protected java.lang.String getAttributeDescription(java.beans.PropertyDescriptor propertyDescriptor, java.lang.String beanKey)
getAttributeDescription
in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
@Nonnull protected java.lang.String getOperationDescription(java.lang.reflect.Method method, java.lang.String beanKey)
Method
from the
metadata. Uses the method name is no description is present in the metadata.getOperationDescription
in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
@Nonnull protected javax.management.MBeanParameterInfo[] getOperationParameters(@Nonnull java.lang.reflect.Method method, java.lang.String beanKey)
MBeanParameterInfo
from the ManagedOperationParameter
attributes attached to a method. Returns an empty array of MBeanParameterInfo
if no attributes are found.getOperationParameters
in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
@Nonnull protected javax.management.modelmbean.ModelMBeanNotificationInfo[] getNotificationInfo(java.lang.Object managedBean, java.lang.String beanKey)
ManagedNotification
metadata from the Class
of the managed resource
and generates and returns the corresponding ModelMBeanNotificationInfo
metadata.getNotificationInfo
in class org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
protected void populateMBeanDescriptor(@Nonnull javax.management.Descriptor desc, java.lang.Object managedBean, java.lang.String beanKey)
ManagedResource
attribute
to the MBean descriptor. Specifically, adds the currencyTimeLimit
,
persistPolicy
, persistPeriod
, persistLocation
and persistName
descriptor fields if they are present in the metadata.populateMBeanDescriptor
in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
protected void populateAttributeDescriptor(@Nonnull javax.management.Descriptor desc, java.lang.reflect.Method getter, java.lang.reflect.Method setter, java.lang.String beanKey)
ManagedAttribute
attribute or the ManagedMetric
attribute
to the attribute descriptor.populateAttributeDescriptor
in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
protected void populateOperationDescriptor(@Nonnull javax.management.Descriptor desc, java.lang.reflect.Method method, java.lang.String beanKey)
ManagedAttribute
attribute to the attribute descriptor. Specifically,
adds the currencyTimeLimit
descriptor field if it is present in the metadata.populateOperationDescriptor
in class org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler
protected void applyRunAsync(javax.management.Descriptor desc, java.lang.reflect.Method operation)
operation
was annotated by JmxRunAsync
.desc
- operation descriptoroperation
- operation