/*
* JBoss, Home of Professional Open Source.
* Copyright 2011, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.as.jmx;

import javax.management.MBeanServer;
import javax.management.MBeanServerBuilder;
import javax.management.MBeanServerDelegate;

/**
 * <p>To use this builder, specify {@code -mbeanserverbuildermodule=org.jboss.as.jmx} when bootstrapping
 * jboss-modules, which in turn sets {@code -Djavax.management.builder.initial=org.jboss.as.jmx.PluggableMBeanServerBuilder}
 * (loaded from this module's {code META-INF/services/javax.management.MBeanServerBuilder}. This builder
 * returns an instance of {@link PluggableMBeanServerImpl} which can be used to set the MBeanServer chain, meaning that the
 * platform mbean server gets the extra functionality for TCCL, ModelController and whatever other behaviour we want to add.</p>
 *
 * <p>If the {@code -mbeanserverbuildermodule} option is not specified, the additional behaviour is only added to
 * calls coming in via the remote connector or MBeanServers injected via a dependency on {@link MBeanServerService}.</p>
 *
 * @author <a href="kabir.khan@jboss.com">Kabir Khan</a>
 */
public class PluggableMBeanServerBuilder extends MBeanServerBuilder {

    public PluggableMBeanServerBuilder() {
    }

    @Override
    public MBeanServer newMBeanServer(String defaultDomain, MBeanServer outer, MBeanServerDelegate delegate) {
        return new PluggableMBeanServerImpl(super.newMBeanServer(defaultDomain, outer, delegate), delegate);
    }
}
@@ -1173,323 +1173,8 @@
  %3Cp%3E
-To use this builder, specify %7B@code -mbeanserverbuildermodule=org.jboss.as.jmx%7D when bootstrapping%0A * jboss-modules, which in turn sets %7B@code -Djavax.management.builder.initial=org.jboss.as.jmx.PluggableMBeanServerBuilder%7D%0A * (loaded from this module's %7Bcode META-INF/services/javax.management.MBeanServerBuilder%7D.
  Thi
@@ -1182,19 +1182,16 @@
  builder
-%0A *
  returns
@@ -1286,16 +1286,19 @@
 r chain,
+%0A *
  meaning
@@ -1306,19 +1306,16 @@
 that the
-%0A *
  platfor
@@ -1412,16 +1412,19 @@
 ehaviour
+%0A *
  we want
@@ -1449,55 +1449,355 @@
  %3Cp%3E
-If the %7B@code -mbeans
+ Main JBM module %7B@code org.jboss.modules.Main%7D loads services from %7B@code org.jboss.as.jmx%7D module, which includes%0A * %7B@code META-INF/services/javax.management.MBeanS
 erver
-b
+B
 uilder
-module%7D option
+%7D where the %7B@code PluggableMBeanServerBuilder%7D is specified.%3C/p%3E%0A *%0A * %3Cp%3EIf the %7B@code PluggableMBeanServerBuilder%7D in the %7B@code javax.management.MBeanServerBuilder%7D
  is 
@@ -1810,16 +1810,19 @@
 ecified,
+%0A *
  the add
@@ -1855,19 +1855,16 @@
 added to
-%0A *
  calls c
@@ -1925,16 +1925,19 @@
 cted via
+%0A *
  a depen

Update class javadoc for PluggableMBeanServerBuilder