Java MBean createMBeanServer()

Here you can find the source of createMBeanServer()

Description

Create and configure (if necessary) and return the MBeanServer with which we will be registering our ModelMBean implementations.

License

Open Source License

Declaration

static synchronized MBeanServer createMBeanServer() 

Method Source Code

//package com.java2s;

import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;

public class Main {
    /** The default MBeanServer domain name is "GemFire" */
    private static final String DEFAULT_DOMAIN = "GemFire";
    /** The <code>MBeanServer</code> for this application */
    private static MBeanServer mbeanServer;

    /**/*from  w w  w  .  ja  v  a2 s.c om*/
     * Create and configure (if necessary) and return the <code>MBeanServer</code> 
     * with which we will be registering our <code>ModelMBean</code> 
     * implementations.
     *
     * @see javax.management.MBeanServer
     */
    static synchronized MBeanServer createMBeanServer() {
        if (mbeanServer == null) {
            mbeanServer = MBeanServerFactory
                    .createMBeanServer(DEFAULT_DOMAIN);
        }
        return mbeanServer;
    }
}

Related

  1. chooseMBean(Set mbeans)
  2. composeMBeanName(String objTypeName, String objInstanceName)
  3. convertToOpenMBeanAttribute(final MBeanAttributeInfo in, final String prefix)
  4. convertToOpenMBeanOperation(MBeanOperationInfo in)
  5. createOpenMBeanAttributeInfo(final OpenType type, final MBeanAttributeInfo in, final String prefix)
  6. createProxy(final ObjectName objectName, final Class mbeanInterface, final MBeanServer mbeanServer)
  7. createTimerMBean(ObjectName name, MBeanServer server)
  8. dumpAttributes(MBeanAttributeInfo[] attributes)