org.quickfixj.jmx
Class JmxExporter

java.lang.Object
  extended by org.quickfixj.jmx.JmxExporter

public class JmxExporter
extends java.lang.Object


Field Summary
static int REGISTRATION_FAIL_ON_EXISTING
          Constant indicating that registration should fail when attempting to register an MBean under a name that already exists.
static int REGISTRATION_IGNORE_EXISTING
          Constant indicating that registration should ignore the affected MBean when attempting to register an MBean under a name that already exists.
static int REGISTRATION_REPLACE_EXISTING
          Constant indicating that registration should replace the affected MBean when attempting to register an MBean under a name that already exists.
 
Constructor Summary
JmxExporter()
           
JmxExporter(javax.management.MBeanServer mbeanServer)
           
JmxExporter(javax.management.MBeanServer mbeanServer, int registrationBehaviour)
           
 
Method Summary
 void export(Connector connector)
           
 javax.management.MBeanServer getMBeanServer()
           
 void registerMBean(java.lang.Object mbean, javax.management.ObjectName objectName)
          Actually register the MBean with the server.
 void setRegistrationBehavior(int registrationBehaviour)
          Specify what action should be taken when attempting to register an MBean under an ObjectName that already exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REGISTRATION_FAIL_ON_EXISTING

public static final int REGISTRATION_FAIL_ON_EXISTING
Constant indicating that registration should fail when attempting to register an MBean under a name that already exists.

This is the default registration behaviour.

See Also:
Constant Field Values

REGISTRATION_IGNORE_EXISTING

public static final int REGISTRATION_IGNORE_EXISTING
Constant indicating that registration should ignore the affected MBean when attempting to register an MBean under a name that already exists.

See Also:
Constant Field Values

REGISTRATION_REPLACE_EXISTING

public static final int REGISTRATION_REPLACE_EXISTING
Constant indicating that registration should replace the affected MBean when attempting to register an MBean under a name that already exists.

See Also:
Constant Field Values
Constructor Detail

JmxExporter

public JmxExporter(javax.management.MBeanServer mbeanServer,
                   int registrationBehaviour)

JmxExporter

public JmxExporter(javax.management.MBeanServer mbeanServer)

JmxExporter

public JmxExporter()
            throws javax.management.JMException
Throws:
javax.management.JMException
Method Detail

setRegistrationBehavior

public void setRegistrationBehavior(int registrationBehaviour)
Specify what action should be taken when attempting to register an MBean under an ObjectName that already exists.

Default is REGISTRATION_FAIL_ON_EXISTING.

See Also:
REGISTRATION_FAIL_ON_EXISTING, REGISTRATION_IGNORE_EXISTING, REGISTRATION_REPLACE_EXISTING

export

public void export(Connector connector)

getMBeanServer

public javax.management.MBeanServer getMBeanServer()

registerMBean

public void registerMBean(java.lang.Object mbean,
                          javax.management.ObjectName objectName)
                   throws javax.management.JMException
Actually register the MBean with the server. The behaviour when encountering an existing MBean can be configured using the registrationBehaviour constructor or setRegistrationBehavior(int). This design (and also code) was unashamedly cribbed from Spring's MBeanRegistrationSupport class. Thanks Spring team!

Parameters:
mbean -
objectName -
Throws:
javax.management.JMException
See Also:
REGISTRATION_FAIL_ON_EXISTING, REGISTRATION_IGNORE_EXISTING, REGISTRATION_REPLACE_EXISTING