类 AbstractMBeanInfoAssembler
- java.lang.Object
- org.springframework.jmx.export.assembler.AbstractMBeanInfoAssembler
- 所有已实现的接口:
MBeanInfoAssembler
public abstract class AbstractMBeanInfoAssembler extends Object implements MBeanInfoAssembler
Abstract implementation of theMBeanInfoAssembler
interface that encapsulates the creation of aModelMBeanInfo
instance but delegates the creation of metadata to subclasses.This class offers two flavors of Class extraction from a managed bean instance:
getTargetClass(java.lang.Object)
, extracting the target class behind any kind of AOP proxy, andgetClassToExpose(java.lang.Object)
, returning the class or interface that will be searched for annotations and exposed to the JMX runtime.- 从以下版本开始:
- 1.2
- 作者:
- Rob Harrop, Juergen Hoeller
构造器概要
构造器 构造器 说明 AbstractMBeanInfoAssembler()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected void
checkManagedBean(Object managedBean)
Check the given bean instance, throwing an IllegalArgumentException if it is not eligible for exposure with this assembler.protected abstract ModelMBeanAttributeInfo[]
getAttributeInfo(Object managedBean, String beanKey)
Get the attribute metadata for the MBean resource.protected String
getClassName(Object managedBean, String beanKey)
Get the class name of the MBean resource.protected Class<?>
getClassToExpose(Class<?> beanClass)
Return the class or interface to expose for the given bean class.protected Class<?>
getClassToExpose(Object managedBean)
Return the class or interface to expose for the given bean.protected ModelMBeanConstructorInfo[]
getConstructorInfo(Object managedBean, String beanKey)
Get the constructor metadata for the MBean resource.protected String
getDescription(Object managedBean, String beanKey)
Get the description of the MBean resource.ModelMBeanInfo
getMBeanInfo(Object managedBean, String beanKey)
Create an instance of theModelMBeanInfoSupport
class supplied with all JMX implementations and populates the metadata through calls to the subclass.protected ModelMBeanNotificationInfo[]
getNotificationInfo(Object managedBean, String beanKey)
Get the notification metadata for the MBean resource.protected abstract ModelMBeanOperationInfo[]
getOperationInfo(Object managedBean, String beanKey)
Get the operation metadata for the MBean resource.protected Class<?>
getTargetClass(Object managedBean)
Return the actual bean class of the given bean instance.protected void
populateMBeanDescriptor(Descriptor descriptor, Object managedBean, String beanKey)
Called after theModelMBeanInfo
instance has been constructed but before it is passed to theMBeanExporter
.
构造器详细资料
AbstractMBeanInfoAssembler
public AbstractMBeanInfoAssembler()
方法详细资料
getMBeanInfo
public ModelMBeanInfo getMBeanInfo(Object managedBean, String beanKey) throws JMException
Create an instance of theModelMBeanInfoSupport
class supplied with all JMX implementations and populates the metadata through calls to the subclass.- 指定者:
getMBeanInfo
在接口中MBeanInfoAssembler
- 参数:
managedBean
- the bean that will be exposed (might be an AOP proxy)beanKey
- the key associated with the managed bean- 返回:
- the populated ModelMBeanInfo instance
- 抛出:
JMException
- in case of errors- 另请参阅:
getDescription(Object, String)
,getAttributeInfo(Object, String)
,getConstructorInfo(Object, String)
,getOperationInfo(Object, String)
,getNotificationInfo(Object, String)
,populateMBeanDescriptor(javax.management.Descriptor, Object, String)
checkManagedBean
protected void checkManagedBean(Object managedBean) throws IllegalArgumentException
Check the given bean instance, throwing an IllegalArgumentException if it is not eligible for exposure with this assembler.Default implementation is empty, accepting every bean instance.
- 参数:
managedBean
- the bean that will be exposed (might be an AOP proxy)- 抛出:
IllegalArgumentException
- the bean is not valid for exposure
getTargetClass
protected Class<?> getTargetClass(Object managedBean)
Return the actual bean class of the given bean instance. This is the class exposed to description-style JMX properties.Default implementation returns the target class for an AOP proxy, and the plain bean class else.
- 参数:
managedBean
- the bean instance (might be an AOP proxy)- 返回:
- the bean class to expose
- 另请参阅:
AopUtils.getTargetClass(Object)
getClassToExpose
protected Class<?> getClassToExpose(Object managedBean)
Return the class or interface to expose for the given bean. This is the class that will be searched for attributes and operations (for example, checked for annotations).- 参数:
managedBean
- the bean instance (might be an AOP proxy)- 返回:
- the bean class to expose
- 另请参阅:
JmxUtils.getClassToExpose(Object)
getClassToExpose
protected Class<?> getClassToExpose(Class<?> beanClass)
Return the class or interface to expose for the given bean class. This is the class that will be searched for attributes and operations- 参数:
beanClass
- the bean class (might be an AOP proxy class)- 返回:
- the bean class to expose
- 另请参阅:
JmxUtils.getClassToExpose(Class)
getClassName
protected String getClassName(Object managedBean, String beanKey) throws JMException
Get the class name of the MBean resource.Default implementation returns a simple description for the MBean based on the class name.
- 参数:
managedBean
- the bean instance (might be an AOP proxy)beanKey
- the key associated with the MBean in the beans map of theMBeanExporter
- 返回:
- the MBean description
- 抛出:
JMException
- in case of errors
getDescription
protected String getDescription(Object managedBean, String beanKey) throws JMException
Get the description of the MBean resource.Default implementation returns a simple description for the MBean based on the class name.
- 参数:
managedBean
- the bean instance (might be an AOP proxy)beanKey
- the key associated with the MBean in the beans map of theMBeanExporter
- 抛出:
JMException
- in case of errors
populateMBeanDescriptor
protected void populateMBeanDescriptor(Descriptor descriptor, Object managedBean, String beanKey) throws JMException
Called after theModelMBeanInfo
instance has been constructed but before it is passed to theMBeanExporter
.Subclasses can implement this method to add additional descriptors to the MBean metadata. Default implementation is empty.
- 参数:
descriptor
- theDescriptor
for the MBean resource.managedBean
- the bean instance (might be an AOP proxy)beanKey
- the key associated with the MBean in the beans map of theMBeanExporter
- 抛出:
JMException
- in case of errors
getConstructorInfo
protected ModelMBeanConstructorInfo[] getConstructorInfo(Object managedBean, String beanKey) throws JMException
Get the constructor metadata for the MBean resource. Subclasses should implement this method to return the appropriate metadata for all constructors that should be exposed in the management interface for the managed resource.Default implementation returns an empty array of
ModelMBeanConstructorInfo
.- 参数:
managedBean
- the bean instance (might be an AOP proxy)beanKey
- the key associated with the MBean in the beans map of theMBeanExporter
- 返回:
- the constructor metadata
- 抛出:
JMException
- in case of errors
getNotificationInfo
protected ModelMBeanNotificationInfo[] getNotificationInfo(Object managedBean, String beanKey) throws JMException
Get the notification metadata for the MBean resource. Subclasses should implement this method to return the appropriate metadata for all notifications that should be exposed in the management interface for the managed resource.Default implementation returns an empty array of
ModelMBeanNotificationInfo
.- 参数:
managedBean
- the bean instance (might be an AOP proxy)beanKey
- the key associated with the MBean in the beans map of theMBeanExporter
- 返回:
- the notification metadata
- 抛出:
JMException
- in case of errors
getAttributeInfo
protected abstract ModelMBeanAttributeInfo[] getAttributeInfo(Object managedBean, String beanKey) throws JMException
Get the attribute metadata for the MBean resource. Subclasses should implement this method to return the appropriate metadata for all the attributes that should be exposed in the management interface for the managed resource.- 参数:
managedBean
- the bean instance (might be an AOP proxy)beanKey
- the key associated with the MBean in the beans map of theMBeanExporter
- 返回:
- the attribute metadata
- 抛出:
JMException
- in case of errors
getOperationInfo
protected abstract ModelMBeanOperationInfo[] getOperationInfo(Object managedBean, String beanKey) throws JMException
Get the operation metadata for the MBean resource. Subclasses should implement this method to return the appropriate metadata for all operations that should be exposed in the management interface for the managed resource.- 参数:
managedBean
- the bean instance (might be an AOP proxy)beanKey
- the key associated with the MBean in the beans map of theMBeanExporter
- 返回:
- the operation metadata
- 抛出:
JMException
- in case of errors