Groovy Documentation

## groovy.util
[Java] Class GroovyMBean

    java.lang.Object
      groovy.lang.GroovyObjectSupport
          groovy.util.GroovyMBean

    public class GroovyMBean
    extends GroovyObjectSupport

A GroovyObject facade for an underlying MBean which acts like a normal groovy object but which is actually implemented via an underlying JMX MBean. Properties and normal method invocations delegate to the MBeanServer to the actual MBean.

Authors:
  James Strachan
  Steve Button
  Paul King

Constructor Summary
`GroovyMBean(javax.management.MBeanServerConnection server, java.lang.String objectName)`
`GroovyMBean(javax.management.MBeanServerConnection server, java.lang.String objectName, boolean ignoreErrors)`
`GroovyMBean(javax.management.MBeanServerConnection server, javax.management.ObjectName name)`
`GroovyMBean(javax.management.MBeanServerConnection server, javax.management.ObjectName name, boolean ignoreErrors)`

Method Summary
`protected java.lang.String` | `createOperationKey(java.lang.String operation, int params)` Construct a simple key based on the method name and the number of parameters
`protected java.lang.String[]` | `createSignature(javax.management.MBeanOperationInfo info)`
`protected java.lang.String` | `describeAttribute(javax.management.MBeanAttributeInfo attr)` Description of the specified attribute name.
`java.lang.String` | `describeAttribute(java.lang.String attributeName)` Description of the specified attribute name.
`java.util.List` | `describeOperation(java.lang.String operationName)` Get the description of the specified operation.
`protected java.lang.String` | `describeOperation(javax.management.MBeanOperationInfo operation)` Description of the operation.
`java.lang.Object` | `getProperty(java.lang.String property)`
`javax.management.MBeanInfo` | `info()`
`java.lang.Object` | `invokeMethod(java.lang.String method, java.lang.Object arguments)`
`java.util.Collection` | `listAttributeDescriptions()` List of string representations of all of the attributes on the MBean.
`java.util.Collection` | `listAttributeNames()` List of the names of each of the attributes on the MBean
`java.util.List` | `listAttributeValues()` The values of each of the attributes on the MBean
`java.util.Collection` | `listOperationDescriptions()` Description of all of the operations available on the MBean.
`java.util.Collection` | `listOperationNames()` Names of all the operations available on the MBean.
`javax.management.ObjectName` | `name()`
`javax.management.MBeanServerConnection` | `server()`
`void` | `setProperty(java.lang.String property, java.lang.Object value)`
`java.lang.String` | `toString()` Return an end user readable representation of the underlying MBean

Methods inherited from class GroovyObjectSupport
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty

Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), 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()

Constructor Detail

### GroovyMBean

    public GroovyMBean(javax.management.MBeanServerConnection server, java.lang.String objectName)

### GroovyMBean

    public GroovyMBean(javax.management.MBeanServerConnection server, java.lang.String objectName, boolean ignoreErrors)

### GroovyMBean

    public GroovyMBean(javax.management.MBeanServerConnection server, javax.management.ObjectName name)

### GroovyMBean

    public GroovyMBean(javax.management.MBeanServerConnection server, javax.management.ObjectName name, boolean ignoreErrors)

Method Detail

### createOperationKey

    protected java.lang.String createOperationKey(java.lang.String operation, int params)

  Construct a simple key based on the method name and the number of parameters
  Parameters:
    `operation` - - the mbean operation name
    `params` - - the number of parameters the operation supports
  Returns:
    simple unique identifier for a method

### createSignature

    protected java.lang.String[] createSignature(javax.management.MBeanOperationInfo info)

### describeAttribute

    protected java.lang.String describeAttribute(javax.management.MBeanAttributeInfo attr)

  Description of the specified attribute name.
  Parameters:
    `attr` - - the attribute
  Returns:
    String the description

### describeAttribute

    public java.lang.String describeAttribute(java.lang.String attributeName)

  Description of the specified attribute name.
  Parameters:
    `attributeName` - - stringified name of the attribute
  Returns:
    the description

### describeOperation

    public java.util.List describeOperation(java.lang.String operationName)

  Get the description of the specified operation. This returns a Collection since operations can be overloaded and one operationName can have multiple forms.
  Parameters:
    `operationName` - the name of the operation to describe
  Returns:
    Collection of operation description

### describeOperation

    protected java.lang.String describeOperation(javax.management.MBeanOperationInfo operation)

  Description of the operation.
  Parameters:
    `operation` - the operation to describe
  Returns:
    pretty-printed description

### getProperty

    public java.lang.Object getProperty(java.lang.String property)

### info

    public javax.management.MBeanInfo info()

### invokeMethod

    public java.lang.Object invokeMethod(java.lang.String method, java.lang.Object arguments)

### listAttributeDescriptions

    public java.util.Collection listAttributeDescriptions()

  List of string representations of all of the attributes on the MBean.
  Returns:
    list of descriptions of each attribute on the mbean

### listAttributeNames

    public java.util.Collection listAttributeNames()

  List of the names of each of the attributes on the MBean
  Returns:
    list of attribute names

### listAttributeValues

    public java.util.List listAttributeValues()

  The values of each of the attributes on the MBean
  Returns:
    list of values of each attribute

### listOperationDescriptions

    public java.util.Collection listOperationDescriptions()

  Description of all of the operations available on the MBean.
  Returns:
    full description of each operation on the MBean

### listOperationNames

    public java.util.Collection listOperationNames()

  Names of all the operations available on the MBean.
  Returns:
    all the operations on the MBean

### name

    public javax.management.ObjectName name()

### server

    public javax.management.MBeanServerConnection server()

### setProperty

    public void setProperty(java.lang.String property, java.lang.Object value)

### toString

    public java.lang.String toString()

  Return an end user readable representation of the underlying MBean
  Returns:
    the user readable description

Groovy Documentation