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

KeyNamingStrategy

open class KeyNamingStrategy : ObjectNamingStrategy, InitializingBean

ObjectNamingStrategy implementation that builds ObjectName instances from the key used in the "beans" map passed to MBeanExporter.

Can also check object name mappings, given as Properties or as mappingLocations of properties files. The key used to look up is the key used in MBeanExporter's "beans" map. If no mapping is found for a given key, the key itself is used to build an ObjectName.

Author
Rob Harrop

Author
Juergen Hoeller

Since
1.2

See Also
#setMappings#setMappingLocation#setMappingLocationsorg.springframework.jmx.export.MBeanExporter#setBeans

Constructors

<init>

KeyNamingStrategy()

ObjectNamingStrategy implementation that builds ObjectName instances from the key used in the "beans" map passed to MBeanExporter.

Can also check object name mappings, given as Properties or as mappingLocations of properties files. The key used to look up is the key used in MBeanExporter's "beans" map. If no mapping is found for a given key, the key itself is used to build an ObjectName.

Functions

afterPropertiesSet

open fun afterPropertiesSet(): Unit

Merges the Properties configured in the mappings and mappingLocations into the final Properties instance used for ObjectName resolution.

getObjectName

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

Attempts to retrieve the ObjectName via the given key, trying to find a mapped value in the mappings first.

setMappingLocation

open fun setMappingLocation(location: Resource): Unit

Set a location of a properties file to be loaded, containing object name mappings.

setMappingLocations

open fun setMappingLocations(vararg mappingLocations: Resource): Unit

Set location of properties files to be loaded, containing object name mappings.

setMappings

open fun setMappings(mappings: Properties): Unit

Set local properties, containing object name mappings, e.g. via the "props" tag in XML bean definitions. These can be considered defaults, to be overridden by properties loaded from files.