groovy.jmx.builder

## Class JmxBuilderModelMBean

- java.lang.Object
- - javax.management.modelmbean.RequiredModelMBean
  - - groovy.jmx.builder.JmxBuilderModelMBean

All Implemented Interfaces:
  java.util.EventListener, javax.management.DynamicMBean, javax.management.MBeanRegistration, javax.management.modelmbean.ModelMBean, javax.management.modelmbean.ModelMBeanNotificationBroadcaster, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, javax.management.NotificationListener, javax.management.PersistentMBean

    public class JmxBuilderModelMBean
    extends javax.management.modelmbean.RequiredModelMBean
    implements javax.management.NotificationListener

The JmxBuilderModelMBean is the MBean class that proxies exported POGO/POJO inside the MBeanServer. When JmxBuilder exports an object instance, an instance of this class is created and exported inside the MBeanServer.

Author:
  Vladimir Vivien

### Constructor Summary

Constructors
Constructor and Description
`JmxBuilderModelMBean()`
`JmxBuilderModelMBean(javax.management.modelmbean.ModelMBeanInfo mbi)`
`JmxBuilderModelMBean(java.lang.Object objectRef)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addEventListeners(javax.management.MBeanServer server, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> descriptor)` Sets up event listeners for this MBean as described in the descriptor.
`void` `addOperationCallListeners(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> descriptor)` Registers listeners for operation calls (i.e.
`void` `handleNotification(javax.management.Notification note, java.lang.Object handback)`
`java.lang.Object` `invoke(java.lang.String opName, java.lang.Object[] opArgs, java.lang.String[] signature)`
`void` `setManagedResource(java.lang.Object obj)`

### Methods inherited from class javax.management.modelmbean.RequiredModelMBean

`addAttributeChangeNotificationListener, addNotificationListener, getAttribute, getAttributes, getClassLoaderRepository, getMBeanInfo, getNotificationInfo, load, postDeregister, postRegister, preDeregister, preRegister, removeAttributeChangeNotificationListener, removeNotificationListener, removeNotificationListener, sendAttributeChangeNotification, sendAttributeChangeNotification, sendNotification, sendNotification, setAttribute, setAttributes, setManagedResource, setModelMBeanInfo, store`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### JmxBuilderModelMBean

    public JmxBuilderModelMBean(java.lang.Object objectRef)
                         throws javax.management.MBeanException,
                                javax.management.RuntimeOperationsException,
                                javax.management.InstanceNotFoundException,
                                javax.management.modelmbean.InvalidTargetObjectTypeException

Throws:
  `javax.management.MBeanException`
  `javax.management.RuntimeOperationsException`
  `javax.management.InstanceNotFoundException`
  `javax.management.modelmbean.InvalidTargetObjectTypeException`

#### JmxBuilderModelMBean

    public JmxBuilderModelMBean()
                         throws javax.management.MBeanException,
                                javax.management.RuntimeOperationsException

Throws:
  `javax.management.MBeanException`
  `javax.management.RuntimeOperationsException`

#### JmxBuilderModelMBean

    public JmxBuilderModelMBean(javax.management.modelmbean.ModelMBeanInfo mbi)
                         throws javax.management.MBeanException,
                                javax.management.RuntimeOperationsException

Throws:
  `javax.management.MBeanException`
  `javax.management.RuntimeOperationsException`

### Method Detail

#### setManagedResource

    public void setManagedResource(java.lang.Object obj)

#### addOperationCallListeners

    public void addOperationCallListeners(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> descriptor)

Registers listeners for operation calls (i.e. method, getter, and setter calls) when invoked on this bean from the MBeanServer. Descriptor should contain a map with layout item -> [Map[methodListener:[target:"", tpe:"", callback:&Closure], ... ,]]

Parameters:
  `descriptor` - MetaMap descriptor containing description of operation call listeners

#### addEventListeners

    public void addEventListeners(javax.management.MBeanServer server,
                                  java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> descriptor)

Sets up event listeners for this MBean as described in the descriptor. The descriptor contains a map with layout {item -> Map[event:"...", from:ObjectName, callback:&Closure],...,}

Parameters:
  `server` - the MBeanServer is to be registered.
  `descriptor` - a map containing info about the event

#### invoke

    public java.lang.Object invoke(java.lang.String opName,
                                   java.lang.Object[] opArgs,
                                   java.lang.String[] signature)
                            throws javax.management.MBeanException,
                                   javax.management.ReflectionException

Specified by:
  `invoke` in interface `javax.management.DynamicMBean`
Overrides:
  `invoke` in class `javax.management.modelmbean.RequiredModelMBean`
Throws:
  `javax.management.MBeanException`
  `javax.management.ReflectionException`

#### handleNotification

    public void handleNotification(javax.management.Notification note,
                                   java.lang.Object handback)

Specified by:
  `handleNotification` in interface `javax.management.NotificationListener`