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.
setMappings, setMappingLocation, setMappingLocations, org.springframework.jmx.export.MBeanExporter#setBeans
| Modifier and Type | Field and Description |
|---|---|
| protected final Log | logger
|
| private Resource[] | mappingLocations
Stores the |
| private Properties | mappings
Stores the mappings of bean key to |
| private Properties | mergedMappings
Stores the result of merging the |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | afterPropertiesSet()
Implements org. Properties configured in the mappings and
mappingLocations into the final Properties instance
used for ObjectName resolution.
|
| public ObjectName | getObjectName(Object
the bean that will be exposed under the
returned managedBean, String ObjectNamethe key associated with this bean in the beans map
passed to the beanKey)MBeanExporterImplements org. ObjectName via the given key, trying to
find a mapped value in the mappings first.
|
| public void | setMappingLocation(Resource location)
Set a location of a properties file to be loaded, containing object name mappings. |
| public void | setMappingLocations(Resource... mappingLocations)
Set location of properties files to be loaded, containing object name mappings. |
| public void | setMappings(Properties mappings)
Set local properties, containing object name mappings, e.g. via the "props" tag in XML bean definitions. |
| logger | back to summary |
|---|---|
| protected final Log logger
| |
| mappingLocations | back to summary |
|---|---|
| private Resource[] mappingLocations Stores the | |
| mappings | back to summary |
|---|---|
| private Properties mappings Stores the mappings of bean key to | |
| mergedMappings | back to summary |
|---|---|
| private Properties mergedMappings Stores the result of merging the | |
| KeyNamingStrategy | back to summary |
|---|---|
| public KeyNamingStrategy() | |
| afterPropertiesSet | back to summary |
|---|---|
| public void afterPropertiesSet() throws IOException Implements org. Merges the
| |
| getObjectName | back to summary |
|---|---|
| public ObjectName getObjectName(Object managedBean, String beanKey) throws MalformedObjectNameException Implements org. Attempts to retrieve the
| |
| setMappingLocation | back to summary |
|---|---|
| public void setMappingLocation(Resource location) Set a location of a properties file to be loaded, containing object name mappings. | |
| setMappingLocations | back to summary |
|---|---|
| public void setMappingLocations(Resource... mappingLocations) Set location of properties files to be loaded, containing object name mappings. | |
| setMappings | back to summary |
|---|---|
| public void setMappings(Properties mappings) 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. | |