Class JmxUtil

java.lang.Object
org.apache.jackrabbit.oak.commons.jmx.JmxUtil

public final class JmxUtil extends Object
Utility methods related to JMX
  • Method Details

    • quoteValueIfRequired

      public static String quoteValueIfRequired(String unquotedValue)
      Checks if the passed value string can be used as is as part of JMX ObjectName 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 MalformedObjectNameException
      Constructs an immutable map with a single "jmx.objectname" key and a new ObjectName as value. The domain of the ObjectName will be WhiteboardUtils.JMX_OAK_DOMAIN. Note that property values as well as the given type and name will get quoted according to quoteValueIfRequired(String).
      Parameters:
      type - The type of bean
      name - The name of the bean
      properties - 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 the ObjectName fails.