|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.jmx.export.naming.KeyNamingStrategy
public class 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
.
setMappings(java.util.Properties)
,
setMappingLocation(org.springframework.core.io.Resource)
,
setMappingLocations(org.springframework.core.io.Resource[])
,
MBeanExporter.setBeans(java.util.Map)
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
logger
Log instance for this class. |
Constructor Summary | |
---|---|
KeyNamingStrategy()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Merges the Properties configured in the mappings and
mappingLocations into the final Properties instance
used for ObjectName resolution. |
ObjectName |
getObjectName(Object managedBean,
String beanKey)
Attempts to retrieve the ObjectName via the given key, trying to
find a mapped value in the mappings first. |
void |
setMappingLocation(Resource location)
Set a location of a properties file to be loaded, containing object name mappings. |
void |
setMappingLocations(Resource[] mappingLocations)
Set location of properties files to be loaded, containing object name mappings. |
void |
setMappings(Properties mappings)
Set local properties, containing object name mappings, e.g. via the "props" tag in XML bean definitions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.apache.commons.logging.Log logger
Log
instance for this class.
Constructor Detail |
---|
public KeyNamingStrategy()
Method Detail |
---|
public void setMappings(Properties mappings)
public void setMappingLocation(Resource location)
public void setMappingLocations(Resource[] mappingLocations)
public void afterPropertiesSet() throws IOException
Properties
configured in the mappings
and
mappingLocations
into the final Properties
instance
used for ObjectName
resolution.
afterPropertiesSet
in interface InitializingBean
IOException
public ObjectName getObjectName(Object managedBean, String beanKey) throws MalformedObjectNameException
ObjectName
via the given key, trying to
find a mapped value in the mappings first.
getObjectName
in interface ObjectNamingStrategy
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
ObjectName
instance
MalformedObjectNameException
- if the resulting ObjectName
is invalid
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |