org.glassfish.gmbal
Class AMXClient

java.lang.Object
  extended by 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.

Author:
ken

Field Summary
static javax.management.ObjectName NULL_OBJECTNAME
          Special object name used to represent a NULL objectName result.
 
Constructor Summary
AMXClient(javax.management.MBeanServerConnection server, javax.management.ObjectName oname)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Object getAttribute(java.lang.String attribute)
           
 javax.management.AttributeList getAttributes(java.lang.String[] attributes)
           
 AMXClient[] getChildren()
          Containment hierarchy: Get all AMXMBeanInterface contained by this one, in no particular order.
 javax.management.MBeanInfo getMBeanInfo()
           
 java.util.Map<java.lang.String,?> getMeta()
          Get all metadata about this MBean.
 java.lang.String 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.
 AMXClient getParent()
          "go up one level": the MBean containing this one, can be null for root
 int hashCode()
           
 java.lang.Object invoke(java.lang.String actionName, java.lang.Object[] params, java.lang.String[] signature)
           
 javax.management.ObjectName objectName()
           
 void setAttribute(javax.management.Attribute attribute)
           
 void setAttribute(java.lang.String name, java.lang.Object value)
           
 javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL_OBJECTNAME

public static final javax.management.ObjectName NULL_OBJECTNAME
Special object name used to represent a NULL objectName result.

Constructor Detail

AMXClient

public AMXClient(javax.management.MBeanServerConnection server,
                 javax.management.ObjectName oname)
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getName

public java.lang.String 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 interface AMXMBeanInterface

getMeta

public java.util.Map<java.lang.String,?> getMeta()
Description copied from interface: AMXMBeanInterface
Get all metadata about this MBean.

Specified by:
getMeta in interface AMXMBeanInterface
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:
getParent in interface AMXMBeanInterface
Returns:
The container of this MBean (null if already at root).

getChildren

public AMXClient[] 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 interface AMXMBeanInterface
Returns:
All children of this AMXMBeanInterface MBean.

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.MBeanException
javax.management.ReflectionException

getMBeanInfo

public javax.management.MBeanInfo getMBeanInfo()

objectName

public javax.management.ObjectName objectName()