Groovy Documentation

groovy.jmx.builder
[Groovy] Class JmxBeanFactory

java.lang.Object
  groovy.util.AbstractFactory
      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
             }],
     ]
 )
 
Authors:
Vladimir Vivien


Method Summary
boolean isLeaf()

java.lang.Object newInstance(FactoryBuilderSupport builder, java.lang.Object nodeName, java.lang.Object nodeParam, java.util.Map nodeAttributes)

boolean onHandleNodeAttributes(FactoryBuilderSupport builder, java.lang.Object node, java.util.Map nodeAttribs)

void onNodeCompleted(FactoryBuilderSupport builder, java.lang.Object parentNode, java.lang.Object thisNode)

 
Methods inherited from class AbstractFactory
isLeaf, isHandlesNodeChildren, onNodeChildren, onHandleNodeAttributes, onNodeCompleted, setChild, onFactoryRegistration, setParent, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll, newInstance
 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Method Detail

isLeaf

boolean isLeaf()


newInstance

java.lang.Object newInstance(FactoryBuilderSupport builder, java.lang.Object nodeName, java.lang.Object nodeParam, java.util.Map nodeAttributes)


onHandleNodeAttributes

boolean onHandleNodeAttributes(FactoryBuilderSupport builder, java.lang.Object node, java.util.Map nodeAttribs)


onNodeCompleted

void onNodeCompleted(FactoryBuilderSupport builder, java.lang.Object parentNode, java.lang.Object thisNode)


 

Groovy Documentation