Class JmxUtil
java.lang.Object
org.apache.jackrabbit.oak.commons.jmx.JmxUtil
Utility methods related to JMX
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Map<String,
ObjectName> createObjectNameMap
(@NotNull String type, @NotNull String name, @NotNull Map<String, String> properties) Constructs an immutable map with a single "jmx.objectname" key and a newObjectName
as value.static String
quoteValueIfRequired
(String unquotedValue) Checks if the passed value string can be used as is as part of JMXObjectName
If it cannot be used then it would return a quoted string which is then safe to be used as part of ObjectName.
-
Method Details
-
quoteValueIfRequired
Checks if the passed value string can be used as is as part of JMXObjectName
If it cannot be used then it would return a quoted string which is then safe to be used as part of ObjectName.This is meant to avoid unnecessary quoting of value
- Parameters:
unquotedValue
- to quote if required- Returns:
- passed value or quoted value if required
-
createObjectNameMap
@NotNull public static @NotNull Map<String,ObjectName> createObjectNameMap(@NotNull @NotNull String type, @NotNull @NotNull String name, @NotNull @NotNull Map<String, String> properties) throws MalformedObjectNameExceptionConstructs an immutable map with a single "jmx.objectname" key and a newObjectName
as value. The domain of theObjectName
will beWhiteboardUtils.JMX_OAK_DOMAIN
. Note that property values as well as the given type and name will get quoted according toquoteValueIfRequired(String)
.- Parameters:
type
- The type of beanname
- The name of the beanproperties
- A map of additional properties- Returns:
- An immutable map with key "jmx.objectname" and a new
ObjectName
constructed from the parameters. - Throws:
MalformedObjectNameException
- If constructing theObjectName
fails.
-