Package: groovy.jmx.builder

## [Groovy] Class JmxBuilderTools

- groovy.jmx.builder.JmxBuilderTools

-     class JmxBuilderTools
      extends Object

  This is a utility class used as a helper for JmxBuilder.

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `static String` | `ATTRIB_KEY_DEFAULT` Descriptor key for an attribute default value.
    `static String` | `ATTRIB_KEY_DESC` Short descriptor key for an attribute description.
    `static String` | `ATTRIB_KEY_DESCRIPTION` Descriptor key for an attribute description.
    `static String` | `ATTRIB_KEY_TYPE` Descriptor key for an attribute type.
    `static String` | `DEFAULT_DOMAIN` Default domain used for generated JMX object names.
    `static String` | `DEFAULT_NAME_TYPE` Default type used for generated JMX object names.
    `static String` | `DESC_KEY` Descriptor key that stores a nested descriptor map.
    `static String` | `DESC_KEY_DISPLAY_NAME` Descriptor key for a display name.
    `static String` | `DESC_KEY_EVENT_MESSAGE` Descriptor key for an event message.
    `static String` | `DESC_KEY_EVENT_NAME` Descriptor key for an event name.
    `static String` | `DESC_KEY_EVENT_SOURCE` Descriptor key for an event source.
    `static String` | `DESC_KEY_EVENT_TYPE` Descriptor key for an event type.
    `static String` | `DESC_KEY_GETMETHOD` Descriptor key for a getter method name.
    `static String` | `DESC_KEY_JMX_NAME` Descriptor key for an ObjectName.
    `static String` | `DESC_KEY_MBEAN_ATTRIBS` Descriptor key for attribute metadata.
    `static String` | `DESC_KEY_MBEAN_CTORS` Descriptor key for constructor metadata.
    `static String` | `DESC_KEY_MBEAN_NOTES` Descriptor key for notification metadata.
    `static String` | `DESC_KEY_MBEAN_OPS` Descriptor key for operation metadata.
    `static String` | `DESC_KEY_MBEAN_RESOURCE` Descriptor key for the managed resource reference.
    `static String` | `DESC_KEY_MBEAN_RESOURCE_TYPE` Descriptor value identifying an object reference resource.
    `static String` | `DESC_KEY_NAME` Descriptor key for a logical name.
    `static String` | `DESC_KEY_READABLE` Descriptor key for readability.
    `static String` | `DESC_KEY_ROLE` Descriptor key for a member role.
    `static String` | `DESC_KEY_SETMETHOD` Descriptor key for a setter method name.
    `static String` | `DESC_KEY_SIGNATURE` Descriptor key for a signature list.
    `static String` | `DESC_KEY_TYPE` Descriptor key for the descriptor type.
    `static String` | `DESC_KEY_WRITABLE` Descriptor key for writability.
    `static String` | `DESC_VAL_TYPE_ATTRIB` Descriptor value for attribute metadata.
    `static String` | `DESC_VAL_TYPE_CTOR` Descriptor value for constructor metadata.
    `static String` | `DESC_VAL_TYPE_GETTER` Descriptor value for getter metadata.
    `static String` | `DESC_VAL_TYPE_MBEAN` Descriptor value for MBean metadata.
    `static String` | `DESC_VAL_TYPE_NOTIFICATION` Descriptor value for notification metadata.
    `static String` | `DESC_VAL_TYPE_OP` Descriptor value for operation metadata.
    `static String` | `DESC_VAL_TYPE_SETTER` Descriptor value for setter metadata.
    `static String` | `EVENT_KEY_CALLBACK` Event packet key for a callback closure.
    `static String` | `EVENT_KEY_CALLBACK_RESULT` Event packet key for a callback result.
    `static String` | `EVENT_KEY_CONTEXTS` Event packet key for callback contexts.
    `static String` | `EVENT_KEY_ISATTRIB` Event packet key indicating attribute handling.
    `static String` | `EVENT_KEY_MESSAGE` Event packet key for an event message.
    `static String` | `EVENT_KEY_METHOD` Event packet key for a target method name.
    `static String` | `EVENT_KEY_METHOD_RESULT` Event packet key for a target method result.
    `static String` | `EVENT_KEY_NAME` Event packet key for an event name.
    `static String` | `EVENT_KEY_NODE_TYPE` Event packet key for the originating node type.
    `static String` | `EVENT_KEY_TARGETS` Event packet key for registered listeners.
    `static String` | `EVENT_KEY_TYPE` Event packet key for an event type.
    `static String` | `EVENT_VAL_NODETYPE_BROADCASTER` Event node type value for broadcasters.
    `static String` | `EVENT_VAL_NODETYPE_LISTENER` Event node type value for listeners.
    `static String` | `JMX_KEY` Embedded JMX descriptor property name.
    `static String` | `NODE_NAME_ATTRIBS` Short builder node name for attributes.
    `static String` | `NODE_NAME_ATTRIBUTES` Canonical builder node name for attributes.
    `static String` | `NODE_NAME_CONSTRUCTORS` Canonical builder node name for constructors.
    `static String` | `NODE_NAME_CTORS` Short builder node name for constructors.
    `static String` | `NODE_NAME_OPERATIONS` Canonical builder node name for operations.
    `static String` | `NODE_NAME_OPS` Short builder node name for operations.
    `static Map` | `PRIMITIVE_TYPES` Maps primitive type names to their JVM primitive classes.
    `static Map` | `TYPE_MAP` Maps supported type aliases to concrete Java classes.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `JmxBuilderTools()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `static String` | `capitalize(String value)` Capitalize the string passed.
    `` | `static ObjectName` | `getDefaultObjectName(Object obj)` Builds a default ObjectName() instance for a given backing POJO/POGO
    `` | `static MBeanServerConnection` | `getMBeanServer()` Returns an MBeanServerConnection instance.
    `` | `static String` | `getNormalizedType(String type)` Returns the proper type's class name when a short version is provided (i.e.
    `` | `static Class[]` | `getSignatureFromParamInfo(Object params)` Returns method signature (as Class[]) given the meta map that describes the method.
    `` | `static boolean` | `isClassMBean(Class cls)` Tests whether the provided class implements MBean.
    `` | `static GroovyMBean` | `registerMBeanFromMap(String regPolicy, Map metaMap)` Registers an MBean described by the supplied metadata map.
    `` | `static String` | `uncapitalize(String value)` Uncapitalizes a string.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Property Detail

    - #### static String ATTRIB_KEY_DEFAULT

      Descriptor key for an attribute default value.

    - #### static String ATTRIB_KEY_DESC

      Short descriptor key for an attribute description.

    - #### static String ATTRIB_KEY_DESCRIPTION

      Descriptor key for an attribute description.

    - #### static String ATTRIB_KEY_TYPE

      Descriptor key for an attribute type.

    - #### static String DEFAULT_DOMAIN

      Default domain used for generated JMX object names.

    - #### static String DEFAULT_NAME_TYPE

      Default type used for generated JMX object names.

    - #### static String DESC_KEY

      Descriptor key that stores a nested descriptor map.

    - #### static String DESC_KEY_DISPLAY_NAME

      Descriptor key for a display name.

    - #### static String DESC_KEY_EVENT_MESSAGE

      Descriptor key for an event message.

    - #### static String DESC_KEY_EVENT_NAME

      Descriptor key for an event name.

    - #### static String DESC_KEY_EVENT_SOURCE

      Descriptor key for an event source.

    - #### static String DESC_KEY_EVENT_TYPE

      Descriptor key for an event type.

    - #### static String DESC_KEY_GETMETHOD

      Descriptor key for a getter method name.

    - #### static String DESC_KEY_JMX_NAME

      Descriptor key for an ObjectName.

    - #### static String DESC_KEY_MBEAN_ATTRIBS

      Descriptor key for attribute metadata.

    - #### static String DESC_KEY_MBEAN_CTORS

      Descriptor key for constructor metadata.

    - #### static String DESC_KEY_MBEAN_NOTES

      Descriptor key for notification metadata.

    - #### static String DESC_KEY_MBEAN_OPS

      Descriptor key for operation metadata.

    - #### static String DESC_KEY_MBEAN_RESOURCE

      Descriptor key for the managed resource reference.

    - #### static String DESC_KEY_MBEAN_RESOURCE_TYPE

      Descriptor value identifying an object reference resource.

    - #### static String DESC_KEY_NAME

      Descriptor key for a logical name.

    - #### static String DESC_KEY_READABLE

      Descriptor key for readability.

    - #### static String DESC_KEY_ROLE

      Descriptor key for a member role.

    - #### static String DESC_KEY_SETMETHOD

      Descriptor key for a setter method name.

    - #### static String DESC_KEY_SIGNATURE

      Descriptor key for a signature list.

    - #### static String DESC_KEY_TYPE

      Descriptor key for the descriptor type.

    - #### static String DESC_KEY_WRITABLE

      Descriptor key for writability.

    - #### static String DESC_VAL_TYPE_ATTRIB

      Descriptor value for attribute metadata.

    - #### static String DESC_VAL_TYPE_CTOR

      Descriptor value for constructor metadata.

    - #### static String DESC_VAL_TYPE_GETTER

      Descriptor value for getter metadata.

    - #### static String DESC_VAL_TYPE_MBEAN

      Descriptor value for MBean metadata.

    - #### static String DESC_VAL_TYPE_NOTIFICATION

      Descriptor value for notification metadata.

    - #### static String DESC_VAL_TYPE_OP

      Descriptor value for operation metadata.

    - #### static String DESC_VAL_TYPE_SETTER

      Descriptor value for setter metadata.

    - #### static String EVENT_KEY_CALLBACK

      Event packet key for a callback closure.

    - #### static String EVENT_KEY_CALLBACK_RESULT

      Event packet key for a callback result.

    - #### static String EVENT_KEY_CONTEXTS

      Event packet key for callback contexts.

    - #### static String EVENT_KEY_ISATTRIB

      Event packet key indicating attribute handling.

    - #### static String EVENT_KEY_MESSAGE

      Event packet key for an event message.

    - #### static String EVENT_KEY_METHOD

      Event packet key for a target method name.

    - #### static String EVENT_KEY_METHOD_RESULT

      Event packet key for a target method result.

    - #### static String EVENT_KEY_NAME

      Event packet key for an event name.

    - #### static String EVENT_KEY_NODE_TYPE

      Event packet key for the originating node type.

    - #### static String EVENT_KEY_TARGETS

      Event packet key for registered listeners.

    - #### static String EVENT_KEY_TYPE

      Event packet key for an event type.

    - #### static String EVENT_VAL_NODETYPE_BROADCASTER

      Event node type value for broadcasters.

    - #### static String EVENT_VAL_NODETYPE_LISTENER

      Event node type value for listeners.

    - #### static String JMX_KEY

      Embedded JMX descriptor property name.

    - #### static String NODE_NAME_ATTRIBS

      Short builder node name for attributes.

    - #### static String NODE_NAME_ATTRIBUTES

      Canonical builder node name for attributes.

    - #### static String NODE_NAME_CONSTRUCTORS

      Canonical builder node name for constructors.

    - #### static String NODE_NAME_CTORS

      Short builder node name for constructors.

    - #### static String NODE_NAME_OPERATIONS

      Canonical builder node name for operations.

    - #### static String NODE_NAME_OPS

      Short builder node name for operations.

    - #### static Map PRIMITIVE_TYPES

      Maps primitive type names to their JVM primitive classes.

    - #### static Map TYPE_MAP

      Maps supported type aliases to concrete Java classes.

  - ### Constructor Detail

    - #### JmxBuilderTools()

  - ### Method Detail

    - #### static String capitalize(String value)

      Capitalize the string passed.

      Parameters:
        `value` - - string to capitalize.
      Returns:
        - a capitalized string.

    - #### static ObjectName getDefaultObjectName(Object obj)

      Builds a default ObjectName() instance for a given backing POJO/POGO

      Parameters:
        `obj` - - the backing pojo/pogo
      Returns:
        the generated ObjectName() instance.

    - #### static MBeanServerConnection getMBeanServer()

      Returns an MBeanServerConnection instance. It searches for declared MBeanServers from the MBeanServerFactory. If none is found, the default Platform MBeanServer is returned.

    - #### static String getNormalizedType(String type)

      Returns the proper type's class name when a short version is provided (i.e. String returns java.lang.String)

      Parameters:
        `type` - - the type name to normalize
      Returns:
        the normalized type name.

    - #### static Class[] getSignatureFromParamInfo(Object params)

      Returns method signature (as Class[]) given the meta map that describes the method.

      Parameters:
        `params` - - the map with parameter info.
      Returns:
        Class[] that represent the method signature.

    - #### static boolean isClassMBean(Class cls)

      Tests whether the provided class implements MBean. It uses the following runes

           if(
               DynamicMBean.class.isAssignable(cls) ||
               cls.getName().endsWith("MBean") ||
               cls.getName().endsWith("MXBean")
           ) then class is MBean

      Parameters:
        `cls` - - class to test
      Returns:
        true = if class implements DynamicMBean or interface name that ends in MBean or MXBean.

    - #### static GroovyMBean registerMBeanFromMap(String regPolicy, Map metaMap)

      Registers an MBean described by the supplied metadata map.

      Parameters:
        `regPolicy` - the registration policy to apply
        `metaMap` - the normalized bean metadata
      Returns:
        the exported bean facade, or `null` when registration is ignored

    - #### static String uncapitalize(String value)

      Uncapitalizes a string.

      Parameters:
        `value` - - string to uncap.
      Returns:
        uncap'ed string.