public final class OrderedObjectNameMapper extends java.lang.Object implements ObjectNameMapper
ObjectNameMapper
that allows the order of
tags to be specified when constructing the ObjectName
.
The mapper will map the known ordered tag keys and then optionally
append the remaining tags. While an ObjectName
's properties
are meant to be unordered some visual tools such as VisualVM use the
given order to build a hierarchy. This ordering allows that hierarchy
to be manipulated.
It is recommended to always append the remaining tags to avoid collisions
in the generated ObjectName
. The mapper remaps any characters that
are not alphanumeric, a period, or hypen to an underscore.
DEFAULT
Constructor and Description |
---|
OrderedObjectNameMapper(boolean appendRemaining,
java.util.List<java.lang.String> orderedKeys)
Creates the mapper specifying the order of keys to use and whether
non-explicitly mentioned tag keys should then be appended or not to
the resulting
ObjectName . |
OrderedObjectNameMapper(boolean appendRemaining,
java.lang.String... orderedKeys)
Creates the mapper specifying the order of keys to use and whether
non-explicitly mentioned tag keys should then be appended or not to
the resulting
ObjectName . |
Modifier and Type | Method and Description |
---|---|
javax.management.ObjectName |
createObjectName(java.lang.String domain,
Monitor<?> monitor)
Given the domain and monitor generates an
ObjectName to use. |
public OrderedObjectNameMapper(boolean appendRemaining, java.lang.String... orderedKeys)
ObjectName
.appendRemaining
- whether to append the remaining tagsorderedKeys
- the keys in order that should be usedpublic OrderedObjectNameMapper(boolean appendRemaining, java.util.List<java.lang.String> orderedKeys)
ObjectName
.appendRemaining
- whether to append the remaining tagsorderedKeys
- the list of keys in the order that should be usedpublic javax.management.ObjectName createObjectName(java.lang.String domain, Monitor<?> monitor)
ObjectNameMapper
ObjectName
to use.createObjectName
in interface ObjectNameMapper
domain
- the JMX domainmonitor
- the monitor