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 theObjectNamingStrategy
interface that creates a name based on the identity of a given instance.The resulting
ObjectName
will 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 String
HASH_CODE_KEY
The hash code key.static String
TYPE_KEY
The type key.
Constructor Summary
Constructors Constructor Description IdentityNamingStrategy()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectName
getObjectName(Object managedBean, String beanKey)
Returns an instance ofObjectName
based on the identity of the managed resource.
Field Detail
TYPE_KEY
public static final String TYPE_KEY
The type key.- See Also:
- Constant Field Values
HASH_CODE_KEY
public static final String HASH_CODE_KEY
The hash code key.- See Also:
- Constant Field Values
Constructor Detail
IdentityNamingStrategy
public IdentityNamingStrategy()
Method Detail
getObjectName
public ObjectName getObjectName(Object managedBean, @Nullable String beanKey) throws MalformedObjectNameException
Returns an instance ofObjectName
based on the identity of the managed resource.- Specified by:
getObjectName
in interfaceObjectNamingStrategy
- Parameters:
managedBean
- the bean that will be exposed under the returnedObjectName
beanKey
- the key associated with this bean in the beans map passed to theMBeanExporter
- Returns:
- the
ObjectName
instance - Throws:
MalformedObjectNameException
- if the resultingObjectName
is invalid