spring-framework / org.springframework.jmx.export.naming / MetadataNamingStrategy

MetadataNamingStrategy

open class MetadataNamingStrategy : ObjectNamingStrategy, InitializingBean

An implementation of the ObjectNamingStrategy interface that reads the ObjectName from the source-level metadata. Falls back to the bean key (bean name) if no ObjectName can be found in source-level metadata.

Uses the JmxAttributeSource strategy interface, so that metadata can be read using any supported implementation. Out of the box, org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource introspects a well-defined set of Java 5 annotations that come with Spring.

Author
Rob Harrop

Author
Juergen Hoeller

Since
1.2

See Also
ObjectNamingStrategyorg.springframework.jmx.export.annotation.AnnotationJmxAttributeSource

Constructors

<init>

MetadataNamingStrategy()

Create a new MetadataNamingStrategy which needs to be configured through the #setAttributeSource method.

MetadataNamingStrategy(attributeSource: JmxAttributeSource)

Create a new MetadataNamingStrategy for the given JmxAttributeSource.

Functions

afterPropertiesSet

open fun afterPropertiesSet(): Unit

getObjectName

open fun getObjectName(managedBean: Any, beanKey: String): ObjectName

Reads the ObjectName from the source-level metadata associated with the managed resource's Class.

setAttributeSource

open fun setAttributeSource(attributeSource: JmxAttributeSource): Unit

Set the implementation of the JmxAttributeSource interface to use when reading the source-level metadata.

setDefaultDomain

open fun setDefaultDomain(defaultDomain: String): Unit

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.