Package org.glassfish.gmbal
Class AMXClient
java.lang.Object
org.glassfish.gmbal.AMXClient
- All Implemented Interfaces:
AMXMBeanInterface
This class implements a generic AMXMBeanInterface MBean which is connected to a possibly
remote MBeanServerConnection (note that MBeanServer isA MBeanServerConnection,
so we can actually create an AMXClientImpl simply by using the MBeanServer
from the mom: this is useful for testing).
Note that this version of the AMXMBeanInterface API provides a generic get/set API that is identical to DynamicMBean, except that it only throws unchecked exceptions. This is far more convenient in practice than the JMX-standard checked exceptions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ObjectName
Special object name used to represent a NULL objectName result.private ObjectName
private MBeanServerConnection
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
private <T> T
fetchAttribute
(String name, Class<T> type) getAttribute
(String attribute) getAttributes
(String[] attributes) Containment hierarchy: Get all AMXMBeanInterface contained by this one, in no particular order.getMeta()
Get all metadata about this MBean.getName()
Usually the same as the ObjectName 'name' property, but can differ if the actual name contains characters that must be escaped for an ObjectName and/or if the MBean has a mutable name attribute."go up one level": the MBean containing this one, can be null for rootint
hashCode()
private AMXClient
makeAMX
(ObjectName on) private AMXClient[]
makeAMXArray
(ObjectName[] onames) private static ObjectName
makeObjectName
(String str) void
setAttribute
(String name, Object value) void
setAttribute
(Attribute attribute) setAttributes
(AttributeList attributes) toString()
-
Field Details
-
NULL_OBJECTNAME
Special object name used to represent a NULL objectName result. -
server
-
oname
-
-
Constructor Details
-
AMXClient
-
-
Method Details
-
makeObjectName
-
equals
-
hashCode
public int hashCode() -
toString
-
fetchAttribute
-
makeAMX
-
getName
Description copied from interface:AMXMBeanInterface
Usually the same as the ObjectName 'name' property, but can differ if the actual name contains characters that must be escaped for an ObjectName and/or if the MBean has a mutable name attribute. The type property can be obtained from the ObjectName- Specified by:
getName
in interfaceAMXMBeanInterface
-
getMeta
Description copied from interface:AMXMBeanInterface
Get all metadata about this MBean.- Specified by:
getMeta
in interfaceAMXMBeanInterface
- Returns:
- The descriptor, which will be a ModelMBeanInfoSupport instance.
-
getParent
Description copied from interface:AMXMBeanInterface
"go up one level": the MBean containing this one, can be null for root- Specified by:
getParent
in interfaceAMXMBeanInterface
- Returns:
- The container of this MBean (null if already at root).
-
getChildren
Description copied from interface:AMXMBeanInterface
Containment hierarchy: Get all AMXMBeanInterface contained by this one, in no particular order. Valid only if isContainer(). Note that using an array sidesteps Map/Set/OpenType issues- Specified by:
getChildren
in interfaceAMXMBeanInterface
- Returns:
- All children of this AMXMBeanInterface MBean.
-
makeAMXArray
-
getAttribute
-
setAttribute
-
setAttribute
-
getAttributes
-
setAttributes
-
invoke
public Object invoke(String actionName, Object[] params, String[] signature) throws MBeanException, ReflectionException - Throws:
MBeanException
ReflectionException
-
getMBeanInfo
-
objectName
-