类 MetadataNamingStrategy
- java.lang.Object
- org.springframework.jmx.export.naming.MetadataNamingStrategy
- 所有已实现的接口:
InitializingBean,ObjectNamingStrategy
public class MetadataNamingStrategy extends Object implements ObjectNamingStrategy, InitializingBean
An implementation of theObjectNamingStrategyinterface that reads theObjectNamefrom the source-level metadata. Falls back to the bean key (bean name) if noObjectNamecan be found in source-level metadata.Uses the
JmxAttributeSourcestrategy interface, so that metadata can be read using any supported implementation. Out of the box,AnnotationJmxAttributeSourceintrospects a well-defined set of Java 5 annotations that come with Spring.- 从以下版本开始:
- 1.2
- 作者:
- Rob Harrop, Juergen Hoeller
- 另请参阅:
ObjectNamingStrategy,AnnotationJmxAttributeSource
构造器概要
构造器 构造器 说明 MetadataNamingStrategy()Create a newMetadataNamingStrategywhich needs to be configured through thesetAttributeSource(org.springframework.jmx.export.metadata.JmxAttributeSource)method.MetadataNamingStrategy(JmxAttributeSource attributeSource)Create a newMetadataNamingStrategyfor the givenJmxAttributeSource.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidafterPropertiesSet()Invoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.ObjectNamegetObjectName(Object managedBean, String beanKey)Reads theObjectNamefrom the source-level metadata associated with the managed resource'sClass.voidsetAttributeSource(JmxAttributeSource attributeSource)Set the implementation of theJmxAttributeSourceinterface to use when reading the source-level metadata.voidsetDefaultDomain(String defaultDomain)Specify the default domain to be used for generating ObjectNames when no source-level metadata has been specified.
构造器详细资料
MetadataNamingStrategy
public MetadataNamingStrategy()
Create a newMetadataNamingStrategywhich needs to be configured through thesetAttributeSource(org.springframework.jmx.export.metadata.JmxAttributeSource)method.
MetadataNamingStrategy
public MetadataNamingStrategy(JmxAttributeSource attributeSource)
Create a newMetadataNamingStrategyfor the givenJmxAttributeSource.- 参数:
attributeSource- the JmxAttributeSource to use
方法详细资料
setAttributeSource
public void setAttributeSource(JmxAttributeSource attributeSource)
Set the implementation of theJmxAttributeSourceinterface to use when reading the source-level metadata.
setDefaultDomain
public void setDefaultDomain(String defaultDomain)
Specify the default domain to be used for generating ObjectNames when no source-level metadata has been specified.The default is to use the domain specified in the bean name (if the bean name follows the JMX ObjectName syntax); else, the package name of the managed bean class.
afterPropertiesSet
public void afterPropertiesSet()
从接口复制的说明:InitializingBeanInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- 指定者:
afterPropertiesSet在接口中InitializingBean
getObjectName
public ObjectName getObjectName(Object managedBean, String beanKey) throws MalformedObjectNameException
Reads theObjectNamefrom the source-level metadata associated with the managed resource'sClass.- 指定者:
getObjectName在接口中ObjectNamingStrategy- 参数:
managedBean- the bean that will be exposed under the returnedObjectNamebeanKey- the key associated with this bean in the beans map passed to theMBeanExporter- 返回:
- the
ObjectNameinstance - 抛出:
MalformedObjectNameException- if the resultingObjectNameis invalid