Package org.glassfish.gmbal
Class AMXClient
- java.lang.Object
-
- org.glassfish.gmbal.AMXClient
-
- All Implemented Interfaces:
AMXMBeanInterface
public class AMXClient extends Object implements 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.
- Author:
- ken
-
-
Field Summary
Fields Modifier and Type Field Description static ObjectNameNULL_OBJECTNAMESpecial object name used to represent a NULL objectName result.
-
Constructor Summary
Constructors Constructor Description AMXClient(MBeanServerConnection server, ObjectName oname)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)ObjectgetAttribute(String attribute)AttributeListgetAttributes(String[] attributes)AMXClient[]getChildren()Containment hierarchy: Get all AMXMBeanInterface contained by this one, in no particular order.MBeanInfogetMBeanInfo()Map<String,?>getMeta()Get all metadata about this MBean.StringgetName()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.AMXClientgetParent()"go up one level": the MBean containing this one, can be null for rootinthashCode()Objectinvoke(String actionName, Object[] params, String[] signature)ObjectNameobjectName()voidsetAttribute(String name, Object value)voidsetAttribute(Attribute attribute)AttributeListsetAttributes(AttributeList attributes)StringtoString()
-
-
-
Field Detail
-
NULL_OBJECTNAME
public static final ObjectName NULL_OBJECTNAME
Special object name used to represent a NULL objectName result.
-
-
Constructor Detail
-
AMXClient
public AMXClient(MBeanServerConnection server, ObjectName oname)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:AMXMBeanInterfaceUsually 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:
getNamein interfaceAMXMBeanInterface
-
getMeta
public Map<String,?> getMeta()
Description copied from interface:AMXMBeanInterfaceGet all metadata about this MBean.- Specified by:
getMetain interfaceAMXMBeanInterface- Returns:
- The descriptor, which will be a ModelMBeanInfoSupport instance.
-
getParent
public AMXClient getParent()
Description copied from interface:AMXMBeanInterface"go up one level": the MBean containing this one, can be null for root- Specified by:
getParentin interfaceAMXMBeanInterface- Returns:
- The container of this MBean (null if already at root).
-
getChildren
public AMXClient[] getChildren()
Description copied from interface:AMXMBeanInterfaceContainment 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:
getChildrenin interfaceAMXMBeanInterface- Returns:
- All children of this AMXMBeanInterface MBean.
-
setAttribute
public void setAttribute(Attribute attribute)
-
getAttributes
public AttributeList getAttributes(String[] attributes)
-
setAttributes
public AttributeList setAttributes(AttributeList attributes)
-
invoke
public Object invoke(String actionName, Object[] params, String[] signature) throws MBeanException, ReflectionException
- Throws:
MBeanExceptionReflectionException
-
getMBeanInfo
public MBeanInfo getMBeanInfo()
-
objectName
public ObjectName objectName()
-
-