public class IdentityNamingStrategy extends Object implements ObjectNamingStrategy
ObjectNamingStrategy
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)
Modifier and Type | Field and Description |
---|---|
static String |
HASH_CODE_KEY
The hash code key.
|
static String |
TYPE_KEY
The type key.
|
Constructor and Description |
---|
IdentityNamingStrategy() |
Modifier and Type | Method and Description |
---|---|
ObjectName |
getObjectName(Object managedBean,
String beanKey)
Returns an instance of
ObjectName based on the identity
of the managed resource. |
public static final String TYPE_KEY
public static final String HASH_CODE_KEY
public ObjectName getObjectName(Object managedBean, @Nullable String beanKey) throws 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
instanceMalformedObjectNameException
- if the resulting ObjectName
is invalid