Class IdentityNamingStrategy
- java.lang.Object
- org.springframework.jmx.export.naming.IdentityNamingStrategy
- All Implemented Interfaces:
ObjectNamingStrategy
public class IdentityNamingStrategy extends Object implements ObjectNamingStrategy
An implementation of theObjectNamingStrategyinterface that creates a name based on the identity of a given instance.The resulting
ObjectNamewill be in the form package:class=class name,hashCode=identity hash (in hex)- Since:
- 1.2
- Author:
- Rob Harrop, Juergen Hoeller
Field Summary
Fields Modifier and Type Field Description static StringHASH_CODE_KEYstatic StringTYPE_KEY
Constructor Summary
Constructors Constructor Description IdentityNamingStrategy()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectNamegetObjectName(Object managedBean, String beanKey)Returns an instance ofObjectNamebased on the identity of the managed resource.
Field Detail
TYPE_KEY
public static final String TYPE_KEY
- See Also:
- Constant Field Values
HASH_CODE_KEY
public static final String HASH_CODE_KEY
- See Also:
- Constant Field Values
Constructor Detail
IdentityNamingStrategy
public IdentityNamingStrategy()
Method Detail
getObjectName
public ObjectName getObjectName(Object managedBean, String beanKey) throws MalformedObjectNameException
Returns an instance ofObjectNamebased on the identity of the managed resource.- Specified by:
getObjectNamein interfaceObjectNamingStrategy- Parameters:
managedBean- the bean that will be exposed under the returnedObjectNamebeanKey- the key associated with this bean in the beans map passed to theMBeanExporter- Returns:
- the
ObjectNameinstance - Throws:
MalformedObjectNameException- if the resultingObjectNameis invalid