Package org.glassfish.gmbal
Class AMXClient
- java.lang.Object
-
- org.glassfish.gmbal.AMXClient
-
- All Implemented Interfaces:
AMXMBeanInterface
public class AMXClient extends java.lang.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.
-
-
Field Summary
Fields Modifier and Type Field Description static javax.management.ObjectNameNULL_OBJECTNAMESpecial object name used to represent a NULL objectName result.private javax.management.ObjectNameonameprivate javax.management.MBeanServerConnectionserver
-
Constructor Summary
Constructors Constructor Description AMXClient(javax.management.MBeanServerConnection server, javax.management.ObjectName oname)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)private <T> TfetchAttribute(java.lang.String name, java.lang.Class<T> type)java.lang.ObjectgetAttribute(java.lang.String attribute)javax.management.AttributeListgetAttributes(java.lang.String[] attributes)AMXClient[]getChildren()Containment hierarchy: Get all AMXMBeanInterface contained by this one, in no particular order.javax.management.MBeanInfogetMBeanInfo()java.util.Map<java.lang.String,?>getMeta()Get all metadata about this MBean.java.lang.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()java.lang.Objectinvoke(java.lang.String actionName, java.lang.Object[] params, java.lang.String[] signature)private AMXClientmakeAMX(javax.management.ObjectName on)private AMXClient[]makeAMXArray(javax.management.ObjectName[] onames)private static javax.management.ObjectNamemakeObjectName(java.lang.String str)javax.management.ObjectNameobjectName()voidsetAttribute(java.lang.String name, java.lang.Object value)voidsetAttribute(javax.management.Attribute attribute)javax.management.AttributeListsetAttributes(javax.management.AttributeList attributes)java.lang.StringtoString()
-
-
-
Method Detail
-
makeObjectName
private static javax.management.ObjectName makeObjectName(java.lang.String str)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
fetchAttribute
private <T> T fetchAttribute(java.lang.String name, java.lang.Class<T> type)
-
makeAMX
private AMXClient makeAMX(javax.management.ObjectName on)
-
getName
public java.lang.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 java.util.Map<java.lang.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.
-
makeAMXArray
private AMXClient[] makeAMXArray(javax.management.ObjectName[] onames)
-
getAttribute
public java.lang.Object getAttribute(java.lang.String attribute)
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)
-
setAttribute
public void setAttribute(javax.management.Attribute attribute)
-
getAttributes
public javax.management.AttributeList getAttributes(java.lang.String[] attributes)
-
setAttributes
public javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
-
invoke
public java.lang.Object invoke(java.lang.String actionName, java.lang.Object[] params, java.lang.String[] signature) throws javax.management.MBeanException, javax.management.ReflectionException- Throws:
javax.management.MBeanExceptionjavax.management.ReflectionException
-
getMBeanInfo
public javax.management.MBeanInfo getMBeanInfo()
-
objectName
public javax.management.ObjectName objectName()
-
-