public class IdentityNamingStrategy extends java.lang.Object implements ObjectNamingStrategy
ObjectNamingStrategy
interface that
creates a name based on the the identity of a given instance.
The resulting ObjectName
will be in the form
package:class=class name,hashCode=identity hash (in hex)
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HASH_CODE_KEY |
static java.lang.String |
TYPE_KEY |
Constructor and Description |
---|
IdentityNamingStrategy() |
Modifier and Type | Method and Description |
---|---|
javax.management.ObjectName |
getObjectName(java.lang.Object managedBean,
java.lang.String beanKey)
Returns an instance of
ObjectName based on the identity
of the managed resource. |
public static final java.lang.String TYPE_KEY
public static final java.lang.String HASH_CODE_KEY
public javax.management.ObjectName getObjectName(java.lang.Object managedBean, java.lang.String beanKey) throws javax.management.MalformedObjectNameException
ObjectName
based on the identity
of the managed resource.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
instancejavax.management.MalformedObjectNameException
- if the resulting ObjectName
is invalid