MBeanInfoAssembler interface that reads
the management interface information from source level metadata.
Uses the JmxAttributeSource strategy interface, so that
metadata can be read using any supported implementation. Out of the box,
Spring provides an implementation based on annotations:
AnnotationJmxAttributeSource.
setAttributeSource, org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource
| Modifier and Type | Field and Description |
|---|---|
| private JmxAttributeSource |
| Access | Constructor and Description |
|---|---|
| public | MetadataMBeanInfoAssembler()
Create a new |
| public | MetadataMBeanInfoAssembler(JmxAttributeSource
the JmxAttributeSource to use attributeSource)Create a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | afterPropertiesSet()
Implements org. BeanFactory after it has set all bean properties
and satisfied BeanFactoryAware, ApplicationContextAware etc.
This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set. |
| protected void | checkManagedBean(Object
the bean that will be exposed (might be an AOP proxy) managedBean)Overrides org. |
| protected String | getAttributeDescription(PropertyDescriptor
the PropertyDescriptor for the attribute propertyDescriptor, String the key associated with the MBean in the beans map
of the beanKey)
Creates a description for the attribute corresponding to this property
descriptor.
MBeanExporter |
| protected String | getDescription(Object
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. |
| protected ModelMBeanNotificationInfo[] | getNotificationInfo(Object
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. ManagedNotification metadata from the Class of the managed resource
and generates and returns the corresponding ModelMBeanNotificationInfo metadata.
|
| protected String | getOperationDescription(Method
the operation method method, String the key associated with the MBean in the beans map
of the beanKey)
Retrieves the description for the supplied MBeanExporterMethod from the
metadata.
|
| protected MBeanParameterInfo[] | getOperationParameters(Method
the method, String Method to get the parameter information forthe key associated with the MBean in the beans map
of the beanKey)MBeanExporterOverrides org. MBeanParameterInfo from the ManagedOperationParameter
attributes attached to a method.
|
| private boolean | hasManagedAttribute(Method method)
Checks to see if the given Method has the |
| private boolean | |
| private boolean | hasManagedOperation(Method
the method to check method)Checks to see if the given Method has the |
| public boolean | includeBean(Class<?>
the class of the bean beanClass, String the name of the bean in the bean factory beanName)Implements org. |
| protected boolean | Returns: whether the method has the appropriate metadatathe operation method method, String the key associated with the MBean in the beans map beanKey)Implements abstract org. |
| protected boolean | Returns: whether the method has the appropriate metadatathe accessor method method, String the key associated with the MBean in the beans map beanKey)Implements abstract org. |
| protected boolean | Returns: whether the method has the appropriate metadatathe mutator method method, String the key associated with the MBean in the beans map beanKey)Implements abstract org. |
| private JmxAttributeSource | |
| 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)
Adds descriptor fields from the MBeanExporterManagedAttribute attribute or the ManagedMetric attribute
to the attribute descriptor.
|
| private void | |
| protected void | populateMBeanDescriptor(Descriptor
the desc, 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)
Adds descriptor fields from the MBeanExporterManagedResource attribute
to the MBean descriptor.
|
| private void | |
| 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)
Adds descriptor fields from the MBeanExporterManagedAttribute attribute
to the attribute descriptor.
|
| private int | resolveIntDescriptor(int
the int value associated with the getter for this attribute getter, int the int associated with the setter for this attribute setter)Determines which of two |
| private Object | Returns: the appropriate Object to use as the value for the descriptorthe Object value associated with the get method getter, Object the Object value associated with the set method setter)Locates the value of a descriptor based on values attached to both the getter and setter methods. |
| private String | Returns: the appropriate String to use as the value for the descriptorthe String value associated with the get method getter, String the String value associated with the set method setter)Locates the value of a descriptor based on values attached to both the getter and setter methods. |
| public void | setAttributeSource(JmxAttributeSource attributeSource)
Set the |
| attributeSource | back to summary |
|---|---|
| private JmxAttributeSource attributeSource
| |
| MetadataMBeanInfoAssembler | back to summary |
|---|---|
| public MetadataMBeanInfoAssembler() Create a new | |
| MetadataMBeanInfoAssembler | back to summary |
|---|---|
| public MetadataMBeanInfoAssembler(JmxAttributeSource attributeSource) Create a new
| |
| afterPropertiesSet | back to summary |
|---|---|
| public void afterPropertiesSet() Implements org. Doc from org. Invoked by the containing This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
| |
| checkManagedBean | back to summary |
|---|---|
| protected void checkManagedBean(Object managedBean) throws IllegalArgumentException Overrides org. Throws an IllegalArgumentException if it encounters a JDK dynamic proxy. Metadata can only be read from target classes and CGLIB proxies!
| |
| getAttributeDescription | back to summary |
|---|---|
| protected String getAttributeDescription(PropertyDescriptor propertyDescriptor, String beanKey) Creates a description for the attribute corresponding to this property descriptor. Attempts to create the description using metadata from either the getter or setter attributes, otherwise uses the property name.
| |
| getDescription | back to summary |
|---|---|
| protected String getDescription(Object managedBean, String beanKey) Overrides org. Reads managed resource description from the source level metadata.
Returns an empty
| |
| getNotificationInfo | back to summary |
|---|---|
| protected ModelMBeanNotificationInfo[] getNotificationInfo(Object managedBean, String beanKey) Overrides org. Reads the
| |
| getOperationDescription | back to summary |
|---|---|
| protected String getOperationDescription(Method method, String beanKey) Retrieves the description for the supplied | |
| getOperationParameters | back to summary |
|---|---|
| protected MBeanParameterInfo[] getOperationParameters(Method method, String beanKey) Overrides org. Reads
| |
| hasManagedAttribute | back to summary |
|---|---|
| private boolean hasManagedAttribute(Method method) Checks to see if the given Method has the | |
| hasManagedMetric | back to summary |
|---|---|
| private boolean hasManagedMetric(Method method) Checks to see if the given Method has the | |
| hasManagedOperation | back to summary |
|---|---|
| private boolean hasManagedOperation(Method method) Checks to see if the given Method has the
| |
| includeBean | back to summary |
|---|---|
| public boolean includeBean(Class<?> beanClass, String beanName) Implements org. Used for auto-detection of beans. Checks to see if the bean's class has a
| |
| includeOperation | back to summary |
|---|---|
| protected boolean includeOperation(Method method, String beanKey) Implements abstract org. Votes on the inclusion of an operation. | |
| includeReadAttribute | back to summary |
|---|---|
| protected boolean includeReadAttribute(Method method, String beanKey) Implements abstract org. Vote on the inclusion of an attribute accessor. | |
| includeWriteAttribute | back to summary |
|---|---|
| protected boolean includeWriteAttribute(Method method, String beanKey) Implements abstract org. Votes on the inclusion of an attribute mutator. | |
| obtainAttributeSource | back to summary |
|---|---|
| private JmxAttributeSource obtainAttributeSource() | |
| populateAttributeDescriptor | back to summary |
|---|---|
| protected void populateAttributeDescriptor(Descriptor desc, Method getter, Method setter, String beanKey) Adds descriptor fields from the
| |
| populateAttributeDescriptor | back to summary |
|---|---|
| private void populateAttributeDescriptor(Descriptor desc, ManagedAttribute gma, ManagedAttribute sma) | |
| populateMBeanDescriptor | back to summary |
|---|---|
| protected void populateMBeanDescriptor(Descriptor desc, Object managedBean, String beanKey) Adds descriptor fields from the
| |
| populateMetricDescriptor | back to summary |
|---|---|
| private void populateMetricDescriptor(Descriptor desc, ManagedMetric metric) | |
| populateOperationDescriptor | back to summary |
|---|---|
| protected void populateOperationDescriptor(Descriptor desc, Method method, String beanKey) Adds descriptor fields from the
| |
| resolveIntDescriptor | back to summary |
|---|---|
| private int resolveIntDescriptor(int getter, int setter) Determines which of two
| |
| resolveObjectDescriptor | back to summary |
|---|---|
| private Object resolveObjectDescriptor(Object getter, Object setter) Locates the value of a descriptor based on values attached to both the getter and setter methods. If both have values supplied then the value attached to the getter is preferred. | |
| resolveStringDescriptor | back to summary |
|---|---|
| private String resolveStringDescriptor(String getter, String setter) Locates the value of a descriptor based on values attached to both the getter and setter methods. If both have values supplied then the value attached to the getter is preferred. The supplied default value is used to check to see if the value associated with the getter has changed from the default. | |
| setAttributeSource | back to summary |
|---|---|
| public void setAttributeSource(JmxAttributeSource attributeSource) Set the | |