Package: groovy.jmx.builder

## [Groovy] Class JmxBeanFactory

- groovy.jmx.builder.JmxBeanFactory

-     class JmxBeanFactory
      extends AbstractFactory

  This factory returns the bean() node. This node is used to declaratively expose a POGO/POJO to be exported to the MBeanServer for management. You can use the builder node to declare the descriptor or embed the descriptor directly in the object being exposed using static variable descriptor (or jmx). You should note that embedded descriptor takes precedence over declared builder descriptor.

  The following shows all of the different syntax forms supported by the node.

       bean(instance)
       bean(target:instance, name:ObjectName|"...", desc|description:"...")
       bean(target:instance,
           server:MBeanServerConnection
           name:ObjectName()|"...",
           desc|description:"...",
           attribs|attributes:"*",
           attribs|attributes:[]
           attribs|attributes:["attribName1","attribName2",..."attribNameN"]
           attribs|attributes:[
               "attribName0":"*",
               "attribName1":[desc|description:"...", default:value, writable|editable:true|false,...]
                "attribName2":[onChange:{event->
                    // onChange event callback code here.
                ]
            ],

           ctors|constructors:"*",
           ctors|constructors:[
               "CtorName0":[],
               "CtorName1":["paramType1","paramType2"],
               "CtorName2":[
                   desc|description:"...",
                   params:[
                        "type0":"*"
                        "type1":[desc|description:"...", name:"...", ]
                   ]
               ]
           ],

           ops|operations:"*",
           ops|operations:["opName1", "opName2", "opName3",...,"opNameN"],
           ops|operations:[
               "opName0":"*",
               "opName1":["type1","type2,"type3"]
               "opName2":[
                   desc:"description",
                   params:[
                       "type0":"*"
                       "type1":[desc|description:"...", name:"...", ],
                       "typeN":[desc|description:"...", name:"...", ],
                   ],
               ],
               "opName3":[
                   onCall:{event->
                       // onCall event callback code here.
      }]
               ],

           listeners:[
               ListenerName:[
                   event: "eventType", from:"object name"|ObjectName(),
                   call:{event->
                       // handler code for event
      }],
           ]
       )

- - ### Constructor Summary

    Constructors
    Constructor and description
    `JmxBeanFactory()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `boolean` | `isLeaf()` Indicates that the bean node may contain nested configuration nodes.
    `` | `Object` | `newInstance(FactoryBuilderSupport builder, Object nodeName, Object nodeParam, Map nodeAttributes)` Creates the meta map used to export a single bean.
    `` | `boolean` | `onHandleNodeAttributes(FactoryBuilderSupport builder, Object node, Map nodeAttribs)` Leaves attribute handling to newInstance(FactoryBuilderSupport, Object, Object, Map).
    `` | `void` | `onNodeCompleted(FactoryBuilderSupport builder, Object parentNode, Object thisNode)` Registers the exported bean and adds it to the parent collection when appropriate.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class AbstractFactory` | `isHandlesNodeChildren, isLeaf, onFactoryRegistration, onHandleNodeAttributes, onNodeChildren, onNodeCompleted, setChild, setParent`

- - ### Constructor Detail

    - #### JmxBeanFactory()

  - ### Method Detail

    - #### boolean isLeaf()

      Indicates that the bean node may contain nested configuration nodes.

      Returns:
        `false`

    - #### Object newInstance(FactoryBuilderSupport builder, Object nodeName, Object nodeParam, Map nodeAttributes)

      Creates the meta map used to export a single bean.

      Parameters:
        `builder` - the active builder
        `nodeName` - the node name
        `nodeParam` - the positional target object, if supplied
        `nodeAttributes` - the named node attributes
      Returns:
        the normalized bean metadata

    - #### boolean onHandleNodeAttributes(FactoryBuilderSupport builder, Object node, Map nodeAttribs)

      Leaves attribute handling to newInstance(FactoryBuilderSupport, Object, Object, Map).

      Parameters:
        `builder` - the active builder
        `node` - the current node
        `nodeAttribs` - remaining node attributes
      Returns:
        `false`

    - #### void onNodeCompleted(FactoryBuilderSupport builder, Object parentNode, Object thisNode)

      Registers the exported bean and adds it to the parent collection when appropriate.

      Parameters:
        `builder` - the active builder
        `parentNode` - the parent export container
        `thisNode` - the bean metadata