Class KeyNamingStrategy
java.lang.Object
org.springframework.jmx.export.naming.KeyNamingStrategy
- All Implemented Interfaces:
- InitializingBean,- ObjectNamingStrategy
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.
- Since:
- 1.2
- Author:
- Rob Harrop, Juergen Hoeller
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidMerges thePropertiesconfigured in themappingsandmappingLocationsinto the finalPropertiesinstance used forObjectNameresolution.getObjectName(Object managedBean, String beanKey) Attempts to retrieve theObjectNamevia the given key, trying to find a mapped value in the mappings first.voidsetMappingLocation(Resource location) Set a location of a properties file to be loaded, containing object name mappings.voidsetMappingLocations(Resource... mappingLocations) Set location of properties files to be loaded, containing object name mappings.voidsetMappings(Properties mappings) Set local properties, containing object name mappings, e.g.
- 
Field Details- 
loggerLoginstance for this class.
 
- 
- 
Constructor Details- 
KeyNamingStrategypublic KeyNamingStrategy()
 
- 
- 
Method Details- 
setMappingsSet 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.
- 
setMappingLocationSet a location of a properties file to be loaded, containing object name mappings.
- 
setMappingLocationsSet location of properties files to be loaded, containing object name mappings.
- 
afterPropertiesSetMerges thePropertiesconfigured in themappingsandmappingLocationsinto the finalPropertiesinstance used forObjectNameresolution.- Specified by:
- afterPropertiesSetin interface- InitializingBean
- Throws:
- IOException
 
- 
getObjectNamepublic ObjectName getObjectName(Object managedBean, @Nullable String beanKey) throws MalformedObjectNameException Attempts to retrieve theObjectNamevia the given key, trying to find a mapped value in the mappings first.- Specified by:
- getObjectNamein interface- ObjectNamingStrategy
- Parameters:
- managedBean- the bean that will be exposed under the returned- ObjectName
- beanKey- the key associated with this bean in the beans map passed to the- MBeanExporter
- Returns:
- the ObjectNameinstance
- Throws:
- MalformedObjectNameException- if the resulting- ObjectNameis invalid
 
 
-