flex.management.jmx
Class MBeanServerGateway

java.lang.Object
  extended by flex.management.jmx.MBeanServerGateway

public class MBeanServerGateway
extends Object

Remoting gateway to the MBean server that hosts Flex MBeans.

Some base javax.management.MBeanServer methods are unimplemented due to the fact that we're interacting with the MBean server from remote Flash clients. Some methods have been modified to better suite remote Flash clients. Other methods are additive, serving as a convenience for Flex applications.

Unimplemented methods from the base MBeanServer API:

Modifications to the base MBeanServer API:

Additonal Flex-specific methods:


Constructor Summary
MBeanServerGateway()
          Constructs a new MBeanServerGateway.
 
Method Summary
 ObjectInstance createMBean(String className, String objectName)
          Instantiates and registers an MBean with the MBean server.
 ObjectInstance createMBean(String className, String objectName, Object[] params, String[] signature)
          Instantiates and registers an MBean with the MBean server.
 ObjectInstance createMBean(String className, String objectName, String loaderName)
          Instantiates and registers an MBean with the MBean server.
 ObjectInstance createMBean(String className, String objectName, String loaderName, Object[] params, String[] signature)
          Instantiates and registers an MBean with the MBean server.
 Object getAttribute(String objectName, String attribute)
          Gets the value of a specific attribute of a named MBean.
 Attribute[] getAttributes(String objectName, String[] attributes)
          Gets the values of several attributes of a named MBean.
 String getDefaultDomain()
          Returns the default domain used for naming MBeans.
 String[] getFlexDomains()
          Returns the narrowed list of Flex domains in which any MBean is currently registered.
 Integer getFlexMBeanCount()
          Returns the number of narrowed Flex MBeans registered in the MBean server.
 ObjectName[] getFlexMBeanObjectNames()
          Returns all the object names for Flex related MBeans.
 Integer getMBeanCount()
          Returns the total number of beans registered in the MBean server.
 MBeanInfo getMBeanInfo(String objectName)
          This method discovers the attributes and operations that an MBean exposes for management by a Flash client.
 ObjectInstance getObjectInstance(String objectName)
          Gets the ObjectInstance for the specified MBean registered with the MBean server.
 Object invoke(String objectName, String operationName, Object[] params, String[] signature)
          Invokes an operation on an MBean.
 boolean isInstanceOf(String objectName, String className)
          Returns true if the specified MBean is an instance of the specified class; otherwise false.
 boolean isRegistered(String objectName)
          Checks whether an MBean, identified by its object name, is already registered with the MBean server.
 ObjectInstance[] queryMBeans(String objectName)
          Gets MBeans controlled by the MBean server.
 ObjectName[] queryNames(String objectName)
          Gets the names of MBeans controlled by the MBean server.
 ObjectInstance registerMBean(Object object, String objectName)
          Registers a pre-existing object as an MBean with the MBean server.
 void setAttribute(String objectName, Attribute attribute)
          Sets the value of the attribute for the specified MBean.
 Attribute[] setAttributes(String objectName, Attribute[] attributes)
          Sets the values for several attributes of the specified MBean.
 void unregisterMBean(String objectName)
          Unregisters an MBean from the MBean server.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MBeanServerGateway

public MBeanServerGateway()
Constructs a new MBeanServerGateway. The gateway exposes the MBean server that Flex MBean are registered with in a remoting-friendly fashion.

Method Detail

createMBean

public ObjectInstance createMBean(String className,
                                  String objectName)
Instantiates and registers an MBean with the MBean server.

Parameters:
className - The class name for the MBean to instantiate.
objectName - The object name of the MBean.
Returns:
An ObjectInstance containing the ObjectName and Java class name of the new MBean.

createMBean

public ObjectInstance createMBean(String className,
                                  String objectName,
                                  String loaderName)
Instantiates and registers an MBean with the MBean server. The class loader to use to load the MBean class is identified by its ObjectName.

Parameters:
className - The class name for the MBean to instantiate.
objectName - The object name of the MBean.
loaderName - The object name of the desired class loader.
Returns:
An ObjectInstance containing the ObjectName and Java class name of the new MBean.

createMBean

public ObjectInstance createMBean(String className,
                                  String objectName,
                                  Object[] params,
                                  String[] signature)
Instantiates and registers an MBean with the MBean server.

Parameters:
className - The class name for the MBean to instantiate.
objectName - The object name of the MBean.
params - An array of parameters to pass to the MBean constructor.
signature - An array containing the type signature for the constructor to invoke.
Returns:
An ObjectInstance containing the ObjectName and Java class name of the new MBean.

createMBean

public ObjectInstance createMBean(String className,
                                  String objectName,
                                  String loaderName,
                                  Object[] params,
                                  String[] signature)
Instantiates and registers an MBean with the MBean server. The class loader to use to load the MBean class is identified by its ObjectName.

Parameters:
className - The class name for the MBean to instantiate.
objectName - The object name of the MBean.
loaderName - The object name of the desired class loader.
params - An array of parameters to pass to the MBean constructor.
signature - An array containing the type signature for the constructor to invoke.
Returns:
An ObjectInstance containing the ObjectName and Java class name of the new MBean.

registerMBean

public ObjectInstance registerMBean(Object object,
                                    String objectName)
Registers a pre-existing object as an MBean with the MBean server.

Parameters:
object - The object to register as an MBean.
objectName - The object name for the MBean.
Returns:
An ObjectInstance containing the ObjectName and Java class name of the new MBean.

unregisterMBean

public void unregisterMBean(String objectName)
Unregisters an MBean from the MBean server.

Parameters:
objectName - The object name of the MBean to unregister.

getObjectInstance

public ObjectInstance getObjectInstance(String objectName)
Gets the ObjectInstance for the specified MBean registered with the MBean server.

Parameters:
objectName - The object name of the MBean.
Returns:
An ObjectInstance containing the ObjectName and Java class name of the MBean.

queryMBeans

public ObjectInstance[] queryMBeans(String objectName)
Gets MBeans controlled by the MBean server. This method allows the following to be obtained: All MBeans, or a set of MBeans specified by pattern matching on the ObjectName, or a specific MBean.

This method does not support a QueryExp argument for additional filtering of the queried set.

Parameters:
objectName - The object name pattern identifying the MBeans to retrieve.
Returns:
A set of ObjectInstances for the selected MBeans.

queryNames

public ObjectName[] queryNames(String objectName)
Gets the names of MBeans controlled by the MBean server. This method allows the following to be obtained: The names of all MBeans, the names of the set of MBeans matching the ObjectName pattern, a specific MBean name.

This method does not support a QueryExp argument for additional filtering of the queried set.

Parameters:
objectName - The object name pattern identifying the MBean names to retrieve.
Returns:
A set of ObjectNames for the selected MBeans.

isRegistered

public boolean isRegistered(String objectName)
Checks whether an MBean, identified by its object name, is already registered with the MBean server.

Parameters:
objectName - The object name of the MBean to be checked.
Returns:
True if the MBean is already registered in the MBean server, false otherwise.

getMBeanCount

public Integer getMBeanCount()
Returns the total number of beans registered in the MBean server.

Returns:
The number of registered MBeans.

getAttribute

public Object getAttribute(String objectName,
                           String attribute)
Gets the value of a specific attribute of a named MBean. The MBean is identified by its object name.

Parameters:
objectName - The object name of the MBean from which the attribute is to be retrieved.
attribute - The name of the attribute to be retrieved.
Returns:
The value of the retrieved attribute.

getAttributes

public Attribute[] getAttributes(String objectName,
                                 String[] attributes)
Gets the values of several attributes of a named MBean.

Parameters:
objectName - The object name of the MBean to get attribute values from.
attributes - The names of the attributes to get values for.
Returns:
The attributes, each containing their name and value.

setAttribute

public void setAttribute(String objectName,
                         Attribute attribute)
Sets the value of the attribute for the specified MBean.

Parameters:
objectName - The name of the MBean.
attribute - The attribute to set.

setAttributes

public Attribute[] setAttributes(String objectName,
                                 Attribute[] attributes)
Sets the values for several attributes of the specified MBean.

Parameters:
objectName - The object name for the MBean.
attributes - The attributes to set.
Returns:
The attributes that were set with their new values.

invoke

public Object invoke(String objectName,
                     String operationName,
                     Object[] params,
                     String[] signature)
Invokes an operation on an MBean.

Parameters:
objectName - The object name of the MBean to invoke the operation on.
operationName - The operation to invoke.
params - The parameters for the operation invocation.
signature - The parameter signature for the operation.
Returns:
The object returned by the operation invocation.

getDefaultDomain

public String getDefaultDomain()
Returns the default domain used for naming MBeans.

Returns:
The default domain.

getMBeanInfo

public MBeanInfo getMBeanInfo(String objectName)
This method discovers the attributes and operations that an MBean exposes for management by a Flash client.

Parameters:
objectName - The name of the MBean to get metadata for.
Returns:
An MBeanInfo instance that describes the MBean.

isInstanceOf

public boolean isInstanceOf(String objectName,
                            String className)
Returns true if the specified MBean is an instance of the specified class; otherwise false.

Parameters:
objectName - The object name of the MBean.
className - The name of the class.

getFlexMBeanObjectNames

public ObjectName[] getFlexMBeanObjectNames()
Returns all the object names for Flex related MBeans.

Returns:
The object names for all Flex related MBeans.

getFlexMBeanCount

public Integer getFlexMBeanCount()
Returns the number of narrowed Flex MBeans registered in the MBean server.

Returns:
The number of narrowed Flex MBeans registered in the MBean server.

getFlexDomains

public String[] getFlexDomains()
Returns the narrowed list of Flex domains in which any MBean is currently registered. The domains are returned in naturally sorted order.

Returns:
The narrowed list of Flex domains in which any MBean is currently registered.


Copyright © 2007 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/lcdsjavadoc/flex/management/jmx/MBeanServerGateway.html