com.ibm.di.api.jmx
Class JMXAgent

java.lang.Object
  extended by com.ibm.di.api.jmx.JMXAgent

public class JMXAgent
extends Object

Class used to to expose all Server API calls through a JMX interface locally and remotely.


Field Summary
static String CONN_JNDI_PATH
          A path to the connector in the JNDI path.
static String MBEAN_SERVER_DOMAIN
          The name of the server domain.
 
Constructor Summary
JMXAgent()
           
 
Method Summary
static MBeanServer getMBeanServer()
          Returns the created MBean server.
static SecurityRegistry getSecRegistry()
          Returns the security register of the local session.
static void initialize()
          Initializes the JMX layer of the Server API.
static void initializeRemote()
          Initializes the remotely exposed JMX layer of the Server API.
static ObjectName registerMBean(BaseAdmin aBaseAdmin)
          Registers a pre-existing object as an MBean with the MBean server.
static void unregisterMBean(ObjectName aObjectName)
          Unregisters an MBean from the MBean server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MBEAN_SERVER_DOMAIN

public static final String MBEAN_SERVER_DOMAIN
The name of the server domain.

See Also:
Constant Field Values

CONN_JNDI_PATH

public static final String CONN_JNDI_PATH
A path to the connector in the JNDI path.

See Also:
Constant Field Values
Constructor Detail

JMXAgent

public JMXAgent()
Method Detail

initialize

public static void initialize()
                       throws DIException
Initializes the JMX layer of the Server API. This method creates MBean server and registers as mbeans the system log, security register, system queue, tombstone manager etc.

Throws:
DIException - if the JMXAgent is already initialized.

initializeRemote

public static void initializeRemote()
                             throws DIException
Initializes the remotely exposed JMX layer of the Server API. This method creates and starts the RMIConnectorServer.

Throws:
DIException - if the JMXAgent is not initialized.

registerMBean

public static ObjectName registerMBean(BaseAdmin aBaseAdmin)
                                throws JMException,
                                       DIException
Registers a pre-existing object as an MBean with the MBean server. This method creates the object name which is passed with the aBaseAdmin parameter to the javax.management.MBeanServer.registerMBean(Object, ObjectName) method.

Parameters:
aBaseAdmin - The MBean to be registered as an MBean.
Returns:
an ObjectName of the newly registered MBean.
Throws:
JMException -
  • if the MBean is already under the control of the MBean server.
  • if the preRegister (MBeanRegistration interface) method of the MBean has thrown an exception. The MBean will not be registered.
  • if aBaseAdmin is not a JMX compliant MBean.
  • if aBaseAdmin passed in parameter is null or no object name is specified.
  • DIException - if the JMXAgent is not initialized.

  • unregisterMBean

    public static void unregisterMBean(ObjectName aObjectName)
                                throws JMException,
                                       DIException
    Unregisters an MBean from the MBean server. The MBean is identified by its object name. Once the method has been invoked, the MBean may no longer be accessed by its object name.

    Parameters:
    aObjectName - The object name of the MBean to be unregistered.
    Throws:
    JMException -
  • if the MBean specified is not registered in the MBean server.
  • if the preDeregister ((MBeanRegistration interface) method of the MBean has thrown an exception.
  • if aObjectName in parameter is null or the MBean you are when trying to unregister is the MBeanServerDelegate MBean.
  • DIException - if the JMXAgent is not initialized.

    getSecRegistry

    public static SecurityRegistry getSecRegistry()
                                           throws DIException
    Returns the security register of the local session.

    Returns:
    the security register
    Throws:
    DIException - if the JMXAgent is not initialized.

    getMBeanServer

    public static MBeanServer getMBeanServer()
                                      throws DIException
    Returns the created MBean server.

    Returns:
    the created MBean server
    Throws:
    DIException - if the JMXAgent is not initialized.