[Java] Class GroovyMBean
- groovy.util.GroovyMBean
@Deprecated 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.
- deprecated:
- Use GroovyMBean
Constructor Summary
Constructor and description |
---|
GroovyMBean
(MBeanServerConnection server, String objectName) |
GroovyMBean
(MBeanServerConnection server, String objectName, boolean ignoreErrors) |
GroovyMBean
(MBeanServerConnection server, ObjectName name) |
GroovyMBean
(MBeanServerConnection server, ObjectName name, boolean ignoreErrors) |
Methods Summary
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) | |
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) | |
public MBeanInfo |
info() | |
public Object |
invokeMethod(String method, Object arguments) | |
public Collection<String> |
listAttributeDescriptions() List of string representations of all of 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 of the operations available on the MBean. | |
public Collection<String> |
listOperationNames() Names of all the operations available on the MBean. | |
public ObjectName |
name() | |
public MBeanServerConnection |
server() | |
public void |
setProperty(String property, Object value) | |
public String |
toString() Return an end user readable representation of the underlying MBean |
Inherited Methods Summary
Methods inherited from class | Name |
---|---|
class GroovyObjectSupport | getMetaClass, setMetaClass |
Constructor Detail
public GroovyMBean(MBeanServerConnection server, String objectName)
public GroovyMBean(MBeanServerConnection server, String objectName, boolean ignoreErrors)
public GroovyMBean(MBeanServerConnection server, ObjectName name)
public GroovyMBean(MBeanServerConnection server, ObjectName name, boolean ignoreErrors)
Method Detail
protected String createOperationKey(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
protected String[] createSignature(MBeanOperationInfo info)
protected String describeAttribute(MBeanAttributeInfo attr)
Description of the specified attribute name.
- Parameters:
-
attr
- - the attribute
- Returns:
- String the description
public String describeAttribute(String attributeName)
Description of the specified attribute name.
- Parameters:
-
attributeName
- - stringified name of the attribute
- Returns:
- the description
public List<String> describeOperation(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
protected String describeOperation(MBeanOperationInfo operation)
Description of the operation.
- Parameters:
-
operation
- the operation to describe
- Returns:
- pretty-printed description
public Object getProperty(String property)
public MBeanInfo info()
public Object invokeMethod(String method, Object arguments)
public Collection<String> listAttributeDescriptions()
List of string representations of all of the attributes on the MBean.
- Returns:
- list of descriptions of each attribute on the mbean
public Collection<String> listAttributeNames()
List of the names of each of the attributes on the MBean
- Returns:
- list of attribute names
public List<String> listAttributeValues()
The values of each of the attributes on the MBean
- Returns:
- list of values of each attribute
public Collection<String> listOperationDescriptions()
Description of all of the operations available on the MBean.
- Returns:
- full description of each operation on the MBean
public Collection<String> listOperationNames()
Names of all the operations available on the MBean.
- Returns:
- all the operations on the MBean
public ObjectName name()
public MBeanServerConnection server()
public void setProperty(String property, Object value)
public String toString()
Return an end user readable representation of the underlying MBean
- Returns:
- the user readable description
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/3.0.7/html/gapi/groovy/util/GroovyMBean.html