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.
| Constructor and description |
|---|
GroovyMBean(MBeanServerConnection server, String objectName)Creates a facade for the named MBean. |
GroovyMBean(MBeanServerConnection server, String objectName, boolean ignoreErrors)Creates a facade for the named MBean. |
GroovyMBean(MBeanServerConnection server, ObjectName name)Creates a facade for the named MBean. |
GroovyMBean(MBeanServerConnection server, ObjectName name, boolean ignoreErrors)Creates a facade for the named MBean. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected String |
createOperationKey(String operation, int params)Construct a simple key based on the method name and the number of parameters |
|
protected String[] |
createSignature(MBeanOperationInfo info)Builds the signature array for an operation. |
|
protected String |
describeAttribute(MBeanAttributeInfo attr)Description of the specified attribute name. |
|
public String |
describeAttribute(String attributeName)Description of the specified attribute name. |
|
public List<String> |
describeOperation(String operationName)Get the description of the specified operation. |
|
protected String |
describeOperation(MBeanOperationInfo operation)Description of the operation. |
|
public Object |
getProperty(String property)Reads an attribute from the wrapped MBean. |
|
public MBeanInfo |
info()Returns cached metadata for the wrapped MBean. |
|
public Object |
invokeMethod(String method, Object arguments)Invokes an operation on the wrapped MBean. |
|
public Collection<String> |
listAttributeDescriptions()List of string representations of all the attributes on the MBean. |
|
public Collection<String> |
listAttributeNames()List of the names of each of the attributes on the MBean |
|
public List<String> |
listAttributeValues()The values of each of the attributes on the MBean |
|
public Collection<String> |
listOperationDescriptions()Description of all the operations available on the MBean. |
|
public Collection<String> |
listOperationNames()Names of all the operations available on the MBean. |
|
public ObjectName |
name()Returns the object name of the wrapped MBean. |
|
public MBeanServerConnection |
server()Returns the backing server connection. |
|
public void |
setProperty(String property, Object value)Writes an attribute on the wrapped MBean. |
|
public String |
toString()Return an end user readable representation of the underlying MBean |
| Methods inherited from class | Name |
|---|---|
class GroovyObjectSupport |
getMetaClass, setMetaClass |
Creates a facade for the named MBean.
server - the server connection to useobjectName - the name of the target MBeanCreates a facade for the named MBean.
server - the server connection to useobjectName - the name of the target MBeanignoreErrors - whether access errors should be ignoredCreates a facade for the named MBean.
server - the server connection to usename - the object name of the target MBeanCreates a facade for the named MBean.
server - the server connection to usename - the object name of the target MBeanignoreErrors - whether access errors should be ignoredConstruct a simple key based on the method name and the number of parameters
operation - - the mbean operation nameparams - - the number of parameters the operation supportsBuilds the signature array for an operation.
info - the operation metadataDescription of the specified attribute name.
attr - - the attributeDescription of the specified attribute name.
attributeName - - stringified name of the attributeGet the description of the specified operation. This returns a Collection since operations can be overloaded and one operationName can have multiple forms.
operationName - the name of the operation to describeDescription of the operation.
operation - the operation to describeReads an attribute from the wrapped MBean.
property - the attribute nameReturns cached metadata for the wrapped MBean.
Invokes an operation on the wrapped MBean.
method - the operation namearguments - the operation argumentsList of string representations of all the attributes on the MBean.
List of the names of each of the attributes on the MBean
The values of each of the attributes on the MBean
Description of all the operations available on the MBean.
Names of all the operations available on the MBean.
Returns the object name of the wrapped MBean.
Returns the backing server connection.
Writes an attribute on the wrapped MBean.
property - the attribute namevalue - the new attribute valueReturn an end user readable representation of the underlying MBean
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.