com.ibm.websphere.management
Interface MBeanFactory


public interface MBeanFactory

The MBeanFactory creates and registers the MBeans that are the management interfaces for the runtime components in the server. It also unregisters the MBeans upon request. It is a singleton object within each Websphere process.

It receives requests from the runtime environment (activateMBean) to create and register MBeans that represent the WAS server runtime components whenever a new runtime object is deployed.

It also receives requests from the runtime environment (deactivateMBean) to unregister the MBean.

There are also utility methods on the MBeanFactory to access the JMX MBeanServer, obtain a configuration identifier for an Object, and use a configuration identifier to find its associated MBean.


Method Summary
 javax.management.ObjectName activateMBean(java.lang.String type, RuntimeCollaborator collaborator, java.lang.String configId)
          Create and register an MBean.
 javax.management.ObjectName activateMBean(java.lang.String type, RuntimeCollaborator collaborator, java.lang.String configId, java.lang.String descriptor)
          Create and register an MBean.
 javax.management.ObjectName activateMBean(java.lang.String type, RuntimeCollaborator collaborator, java.lang.String configId, java.lang.String descriptor, java.util.Properties keyProperties)
          Create and register an MBean.
 void deactivateMBean(javax.management.ObjectName mbean)
          Unregister the MBean.
 void deactivateMBean(java.lang.String configId)
          Unregister the MBean.
 javax.management.ObjectName findMBean(java.lang.String configId)
          Find an MBean by its configuration identifier.
 java.lang.String getConfigId(java.lang.Object target)
          Get the configuration identifier for an Object.
 javax.management.MBeanServer getMBeanServer()
          Get the JMX MBeanServer used by the WebSphere administration system.
 java.util.List getMBeanTypes()
          Get a list of MBean types registered through the MBeanFactory.
 

Method Detail

getMBeanServer

public javax.management.MBeanServer getMBeanServer()
Get the JMX MBeanServer used by the WebSphere administration system.

Returns:
the JMX MBeanServer

getMBeanTypes

public java.util.List getMBeanTypes()
Get a list of MBean types registered through the MBeanFactory.

Returns:
the MBean type List

activateMBean

public javax.management.ObjectName activateMBean(java.lang.String type,
                                                 RuntimeCollaborator collaborator,
                                                 java.lang.String configId,
                                                 java.lang.String descriptor)
                                          throws AdminException
Create and register an MBean.

A runtime object invokes this method to create and register a ModelMBean that represents it. The runtime object attributes and operations are exposed as a management interface accessible through the WebSphere AdminService API. The MBeanFactory loads the MBean XML Descriptor, creates an instance of the MBean, and register it with the MBeanServer. This version of the activateMBean API requires four parameters.

Parameters:
type - the type of the MBean.
collaborator - the RuntimeCollaborator object that has responsibility to bind the ModelMBean with the runtime object(s) such that calls on the management interface are delegated to the appropriate methods of the runtime object(s).
configId - the String used by the configuration system to identify the configuration data for the managed runtime object.
descriptor - the file name of the MBean XML descriptor file. If null is specified, the default is MBean type.xml.
Returns:
the JMX ObjectName for the newly created MBean.
Throws:
AdminException - the parent type for several exceptions that can occur
See Also:
RuntimeCollaborator

activateMBean

public javax.management.ObjectName activateMBean(java.lang.String type,
                                                 RuntimeCollaborator collaborator,
                                                 java.lang.String configId,
                                                 java.lang.String descriptor,
                                                 java.util.Properties keyProperties)
                                          throws AdminException
Create and register an MBean.

A runtime object invokes this method to create and register a ModelMBean that represents it. The runtime object attributes and operations are exposed as a management interface accessible through the WebSphere AdminService API. The MBeanFactory loads the MBean XML Descriptor, creates an instance of the MBean, and register it with the MBeanServer. This version of the activateMBean API requires five parameters.

Parameters:
type - the type of the MBean.
collaborator - the RuntimeCollaborator object that has responsibility to bind the ModelMBean with the runtime object(s) such that calls on the management interface are delegated to the appropriate methods of the runtime object(s).
configId - the String used by the configuration system to identify the configuration data for the managed runtime object.
descriptor - the file name of the MBean XML descriptor file. If null is specified, the default is MBean type.xml.
keyProperties - An optional Properties set that will be added to the JMX ObjectName created for the MBean.
Returns:
the JMX ObjectName for the newly created MBean.
Throws:
AdminException - the parent type for several exceptions that can occur.
See Also:
RuntimeCollaborator

activateMBean

public javax.management.ObjectName activateMBean(java.lang.String type,
                                                 RuntimeCollaborator collaborator,
                                                 java.lang.String configId)
                                          throws AdminException
Create and register an MBean.

A runtime object invokes this method to create and register a ModelMBean that represents it. The runtime object attributes and operations are exposed as a management interface accessible through the WebSphere AdminService API. The MBeanFactory loads the MBean XML Descriptor, creates an instance of the MBean, and register it with the MBeanServer. This version of the activateMBean API requires three parameters.

Parameters:
type - the type of the MBean.
collaborator - the RuntimeCollaborator object that has responsibility to bind the ModelMBean with the runtime object(s) such that calls on the management interface are delegated to the appropriate methods of the runtime object(s).
configId - the String used by the configuration system to identify the configuration data for the managed runtime object.
Returns:
the JMX ObjectName for the newly created MBean.
Throws:
AdminException - the parent type for several exceptions that can occur.
See Also:
RuntimeCollaborator

deactivateMBean

public void deactivateMBean(java.lang.String configId)
                     throws AdminException
Unregister the MBean.

A runtime object invokes this method to unregister an ModelMBean that represents it when that runtime object decides that it no longer wishes to expose a management interface.

Parameters:
configId - the String used by the configuration system to identify the managed runtime object.

Throws:
AdminException - the parent type for several exceptions that can occur.

deactivateMBean

public void deactivateMBean(javax.management.ObjectName mbean)
                     throws AdminException
Unregister the MBean.

A runtime object invokes this method to unregister an ModelMBean that represents it when that runtime object decides that it no longer wishes to expose a management interface.

Parameters:
mbean - the JMX ObjectName for the MBean to be deactivated.

Throws:
AdminException - the parent type for several exceptions that can occur.

findMBean

public javax.management.ObjectName findMBean(java.lang.String configId)
                                      throws javax.management.InstanceNotFoundException
Find an MBean by its configuration identifier.

Parameters:
configId - the String used by the configuration system to identify the managed runtime object.
Returns:
ObjectName the JMX ObjectName of the MBean that contains the associated configId.
Throws:
javax.management.InstanceNotFoundException - no matched MBean is found.

getConfigId

public java.lang.String getConfigId(java.lang.Object target)
                             throws AdminException
Get the configuration identifier for an Object.

Parameters:
target - the Object for which a configuration identifier is desired.
Returns:
an appropriate configuration identifier for the Object.
Throws:
AdminException - the parent type for several exceptions that can occur.


 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.