org.objectweb.easybeans.jmx
Class MBeanServerHelper

java.lang.Object
  extended by org.objectweb.easybeans.jmx.MBeanServerHelper

public final class MBeanServerHelper
extends java.lang.Object

Allow to start an MBean server and get an MBeanServer.

Author:
Florent Benoit

Field Summary
private static java.lang.String DEFAULT_DOMAIN_NAME
          Default domain name.
private static java.lang.String idMbeanServer
          Id of the generated MBeanServer.
private static javax.management.MBeanServer mbeanServer
          MBeanServer.
 
Constructor Summary
private MBeanServerHelper()
          Utility class, no public constructor.
 
Method Summary
protected static java.lang.String getIdMbeanServer()
           
private static javax.management.MBeanServer getInternalMBeanServer()
           
static javax.management.MBeanServer getMBeanServerServer()
          Gets first available MBean Server.
static void startMBeanServer()
          Starts an MBeanServer if no MBeanServer is available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mbeanServer

private static javax.management.MBeanServer mbeanServer
MBeanServer.


idMbeanServer

private static java.lang.String idMbeanServer
Id of the generated MBeanServer.


DEFAULT_DOMAIN_NAME

private static final java.lang.String DEFAULT_DOMAIN_NAME
Default domain name.

See Also:
Constant Field Values
Constructor Detail

MBeanServerHelper

private MBeanServerHelper()
Utility class, no public constructor.

Method Detail

getMBeanServerServer

public static javax.management.MBeanServer getMBeanServerServer()
                                                         throws JMXRemoteException
Gets first available MBean Server.

Returns:
first available MBean server.
Throws:
JMXRemoteException - if no server is available

getInternalMBeanServer

private static javax.management.MBeanServer getInternalMBeanServer()
Returns:
first MBean server found.

startMBeanServer

public static void startMBeanServer()
                             throws MBeanServerException
Starts an MBeanServer if no MBeanServer is available.

Throws:
MBeanServerException - if MBeanServer can't be started

getIdMbeanServer

protected static java.lang.String getIdMbeanServer()
Returns:
the id of the created MbeanServer.