com.sun.jmx.interceptor.DefaultMBeanServerInterceptor Java Examples

The following examples show how to use com.sun.jmx.interceptor.DefaultMBeanServerInterceptor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JmxMBeanServer.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * <b>Package:</b> Creates an MBeanServer.
 * @param domain The default domain name used by this MBeanServer.
 * @param outer A pointer to the MBeanServer object that must be
 *        passed to the MBeans when invoking their
 *        {@link javax.management.MBeanRegistration} interface.
 * @param delegate A pointer to the MBeanServerDelegate associated
 *        with the new MBeanServer. The new MBeanServer must register
 *        this MBean in its MBean repository.
 * @param instantiator The MBeanInstantiator that will be used to
 *        instantiate MBeans and take care of class loading issues.
 * @param metadata The MetaData object that will be used by the
 *        MBean server in order to invoke the MBean interface of
 *        the registered MBeans.
 * @param interceptors If <code>true</code>,
 *        {@link MBeanServerInterceptor} will be enabled (default is
 *        <code>false</code>).
 * @param fairLock If {@code true}, the MBean repository will use a {@link
 *        java.util.concurrent.locks.ReentrantReadWriteLock#ReentrantReadWriteLock(boolean)
 *        fair locking} policy.
 */
JmxMBeanServer(String domain, MBeanServer outer,
               MBeanServerDelegate    delegate,
               MBeanInstantiator      instantiator,
               boolean                interceptors,
               boolean                fairLock)  {

    if (instantiator == null) {
        final ModifiableClassLoaderRepository
            clr = new ClassLoaderRepositorySupport();
        instantiator = new MBeanInstantiator(clr);
    }

    final MBeanInstantiator fInstantiator = instantiator;
    this.secureClr = new
        SecureClassLoaderRepository(AccessController.doPrivileged(new PrivilegedAction<ClassLoaderRepository>() {
            @Override
            public ClassLoaderRepository run() {
                return fInstantiator.getClassLoaderRepository();
            }
        })
    );
    if (delegate == null)
        delegate = new MBeanServerDelegateImpl();
    if (outer == null)
        outer = this;

    this.instantiator = instantiator;
    this.mBeanServerDelegateObject = delegate;
    this.outerShell   = outer;

    final Repository repository = new Repository(domain);
    this.mbsInterceptor =
        new DefaultMBeanServerInterceptor(outer, delegate, instantiator,
                                          repository);
    this.interceptorsEnabled = interceptors;
    initialize();
}
 
Example #2
Source File: JmxMBeanServer.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <b>Package:</b> Creates an MBeanServer.
 * @param domain The default domain name used by this MBeanServer.
 * @param outer A pointer to the MBeanServer object that must be
 *        passed to the MBeans when invoking their
 *        {@link javax.management.MBeanRegistration} interface.
 * @param delegate A pointer to the MBeanServerDelegate associated
 *        with the new MBeanServer. The new MBeanServer must register
 *        this MBean in its MBean repository.
 * @param instantiator The MBeanInstantiator that will be used to
 *        instantiate MBeans and take care of class loading issues.
 * @param metadata The MetaData object that will be used by the
 *        MBean server in order to invoke the MBean interface of
 *        the registered MBeans.
 * @param interceptors If <code>true</code>,
 *        {@link MBeanServerInterceptor} will be enabled (default is
 *        <code>false</code>).
 * @param fairLock If {@code true}, the MBean repository will use a {@link
 *        java.util.concurrent.locks.ReentrantReadWriteLock#ReentrantReadWriteLock(boolean)
 *        fair locking} policy.
 */
JmxMBeanServer(String domain, MBeanServer outer,
               MBeanServerDelegate    delegate,
               MBeanInstantiator      instantiator,
               boolean                interceptors,
               boolean                fairLock)  {

    if (instantiator == null) {
        final ModifiableClassLoaderRepository
            clr = new ClassLoaderRepositorySupport();
        instantiator = new MBeanInstantiator(clr);
    }

    final MBeanInstantiator fInstantiator = instantiator;
    this.secureClr = new
        SecureClassLoaderRepository(AccessController.doPrivileged(new PrivilegedAction<ClassLoaderRepository>() {
            @Override
            public ClassLoaderRepository run() {
                return fInstantiator.getClassLoaderRepository();
            }
        })
    );
    if (delegate == null)
        delegate = new MBeanServerDelegateImpl();
    if (outer == null)
        outer = this;

    this.instantiator = instantiator;
    this.mBeanServerDelegateObject = delegate;
    this.outerShell   = outer;

    final Repository repository = new Repository(domain);
    this.mbsInterceptor =
        new DefaultMBeanServerInterceptor(outer, delegate, instantiator,
                                          repository);
    this.interceptorsEnabled = interceptors;
    initialize();
}
 
Example #3
Source File: JmxMBeanServer.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <b>Package:</b> Creates an MBeanServer.
 * @param domain The default domain name used by this MBeanServer.
 * @param outer A pointer to the MBeanServer object that must be
 *        passed to the MBeans when invoking their
 *        {@link javax.management.MBeanRegistration} interface.
 * @param delegate A pointer to the MBeanServerDelegate associated
 *        with the new MBeanServer. The new MBeanServer must register
 *        this MBean in its MBean repository.
 * @param instantiator The MBeanInstantiator that will be used to
 *        instantiate MBeans and take care of class loading issues.
 * @param metadata The MetaData object that will be used by the
 *        MBean server in order to invoke the MBean interface of
 *        the registered MBeans.
 * @param interceptors If <code>true</code>,
 *        {@link MBeanServerInterceptor} will be enabled (default is
 *        <code>false</code>).
 * @param fairLock If {@code true}, the MBean repository will use a {@link
 *        java.util.concurrent.locks.ReentrantReadWriteLock#ReentrantReadWriteLock(boolean)
 *        fair locking} policy.
 */
JmxMBeanServer(String domain, MBeanServer outer,
               MBeanServerDelegate    delegate,
               MBeanInstantiator      instantiator,
               boolean                interceptors,
               boolean                fairLock)  {

    if (instantiator == null) {
        final ModifiableClassLoaderRepository
            clr = new ClassLoaderRepositorySupport();
        instantiator = new MBeanInstantiator(clr);
    }

    final MBeanInstantiator fInstantiator = instantiator;
    this.secureClr = new
        SecureClassLoaderRepository(AccessController.doPrivileged(new PrivilegedAction<ClassLoaderRepository>() {
            @Override
            public ClassLoaderRepository run() {
                return fInstantiator.getClassLoaderRepository();
            }
        })
    );
    if (delegate == null)
        delegate = new MBeanServerDelegateImpl();
    if (outer == null)
        outer = this;

    this.instantiator = instantiator;
    this.mBeanServerDelegateObject = delegate;
    this.outerShell   = outer;

    final Repository repository = new Repository(domain);
    this.mbsInterceptor =
        new DefaultMBeanServerInterceptor(outer, delegate, instantiator,
                                          repository);
    this.interceptorsEnabled = interceptors;
    initialize();
}
 
Example #4
Source File: JmxMBeanServer.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <b>Package:</b> Creates an MBeanServer.
 * @param domain The default domain name used by this MBeanServer.
 * @param outer A pointer to the MBeanServer object that must be
 *        passed to the MBeans when invoking their
 *        {@link javax.management.MBeanRegistration} interface.
 * @param delegate A pointer to the MBeanServerDelegate associated
 *        with the new MBeanServer. The new MBeanServer must register
 *        this MBean in its MBean repository.
 * @param instantiator The MBeanInstantiator that will be used to
 *        instantiate MBeans and take care of class loading issues.
 * @param metadata The MetaData object that will be used by the
 *        MBean server in order to invoke the MBean interface of
 *        the registered MBeans.
 * @param interceptors If <code>true</code>,
 *        {@link MBeanServerInterceptor} will be enabled (default is
 *        <code>false</code>).
 * @param fairLock If {@code true}, the MBean repository will use a {@link
 *        java.util.concurrent.locks.ReentrantReadWriteLock#ReentrantReadWriteLock(boolean)
 *        fair locking} policy.
 */
JmxMBeanServer(String domain, MBeanServer outer,
               MBeanServerDelegate    delegate,
               MBeanInstantiator      instantiator,
               boolean                interceptors,
               boolean                fairLock)  {

    if (instantiator == null) {
        final ModifiableClassLoaderRepository
            clr = new ClassLoaderRepositorySupport();
        instantiator = new MBeanInstantiator(clr);
    }

    final MBeanInstantiator fInstantiator = instantiator;
    this.secureClr = new
        SecureClassLoaderRepository(AccessController.doPrivileged(new PrivilegedAction<ClassLoaderRepository>() {
            @Override
            public ClassLoaderRepository run() {
                return fInstantiator.getClassLoaderRepository();
            }
        })
    );
    if (delegate == null)
        delegate = new MBeanServerDelegateImpl();
    if (outer == null)
        outer = this;

    this.instantiator = instantiator;
    this.mBeanServerDelegateObject = delegate;
    this.outerShell   = outer;

    final Repository repository = new Repository(domain);
    this.mbsInterceptor =
        new DefaultMBeanServerInterceptor(outer, delegate, instantiator,
                                          repository);
    this.interceptorsEnabled = interceptors;
    initialize();
}
 
Example #5
Source File: JmxMBeanServer.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * <b>Package:</b> Creates an MBeanServer.
 * @param domain The default domain name used by this MBeanServer.
 * @param outer A pointer to the MBeanServer object that must be
 *        passed to the MBeans when invoking their
 *        {@link javax.management.MBeanRegistration} interface.
 * @param delegate A pointer to the MBeanServerDelegate associated
 *        with the new MBeanServer. The new MBeanServer must register
 *        this MBean in its MBean repository.
 * @param instantiator The MBeanInstantiator that will be used to
 *        instantiate MBeans and take care of class loading issues.
 * @param metadata The MetaData object that will be used by the
 *        MBean server in order to invoke the MBean interface of
 *        the registered MBeans.
 * @param interceptors If <code>true</code>,
 *        {@link MBeanServerInterceptor} will be enabled (default is
 *        <code>false</code>).
 * @param fairLock If {@code true}, the MBean repository will use a {@link
 *        java.util.concurrent.locks.ReentrantReadWriteLock#ReentrantReadWriteLock(boolean)
 *        fair locking} policy.
 */
JmxMBeanServer(String domain, MBeanServer outer,
               MBeanServerDelegate    delegate,
               MBeanInstantiator      instantiator,
               boolean                interceptors,
               boolean                fairLock)  {

    if (instantiator == null) {
        final ModifiableClassLoaderRepository
            clr = new ClassLoaderRepositorySupport();
        instantiator = new MBeanInstantiator(clr);
    }

    final MBeanInstantiator fInstantiator = instantiator;
    this.secureClr = new
        SecureClassLoaderRepository(AccessController.doPrivileged(new PrivilegedAction<ClassLoaderRepository>() {
            @Override
            public ClassLoaderRepository run() {
                return fInstantiator.getClassLoaderRepository();
            }
        })
    );
    if (delegate == null)
        delegate = new MBeanServerDelegateImpl();
    if (outer == null)
        outer = this;

    this.instantiator = instantiator;
    this.mBeanServerDelegateObject = delegate;
    this.outerShell   = outer;

    final Repository repository = new Repository(domain);
    this.mbsInterceptor =
        new DefaultMBeanServerInterceptor(outer, delegate, instantiator,
                                          repository);
    this.interceptorsEnabled = interceptors;
    initialize();
}
 
Example #6
Source File: JmxMBeanServer.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <b>Package:</b> Creates an MBeanServer.
 * @param domain The default domain name used by this MBeanServer.
 * @param outer A pointer to the MBeanServer object that must be
 *        passed to the MBeans when invoking their
 *        {@link javax.management.MBeanRegistration} interface.
 * @param delegate A pointer to the MBeanServerDelegate associated
 *        with the new MBeanServer. The new MBeanServer must register
 *        this MBean in its MBean repository.
 * @param instantiator The MBeanInstantiator that will be used to
 *        instantiate MBeans and take care of class loading issues.
 * @param metadata The MetaData object that will be used by the
 *        MBean server in order to invoke the MBean interface of
 *        the registered MBeans.
 * @param interceptors If <code>true</code>,
 *        {@link MBeanServerInterceptor} will be enabled (default is
 *        <code>false</code>).
 * @param fairLock If {@code true}, the MBean repository will use a {@link
 *        java.util.concurrent.locks.ReentrantReadWriteLock#ReentrantReadWriteLock(boolean)
 *        fair locking} policy.
 */
JmxMBeanServer(String domain, MBeanServer outer,
               MBeanServerDelegate    delegate,
               MBeanInstantiator      instantiator,
               boolean                interceptors,
               boolean                fairLock)  {

    if (instantiator == null) {
        final ModifiableClassLoaderRepository
            clr = new ClassLoaderRepositorySupport();
        instantiator = new MBeanInstantiator(clr);
    }

    final MBeanInstantiator fInstantiator = instantiator;
    this.secureClr = new
        SecureClassLoaderRepository(AccessController.doPrivileged(new PrivilegedAction<ClassLoaderRepository>() {
            @Override
            public ClassLoaderRepository run() {
                return fInstantiator.getClassLoaderRepository();
            }
        })
    );
    if (delegate == null)
        delegate = new MBeanServerDelegateImpl();
    if (outer == null)
        outer = this;

    this.instantiator = instantiator;
    this.mBeanServerDelegateObject = delegate;
    this.outerShell   = outer;

    final Repository repository = new Repository(domain);
    this.mbsInterceptor =
        new DefaultMBeanServerInterceptor(outer, delegate, instantiator,
                                          repository);
    this.interceptorsEnabled = interceptors;
    initialize();
}
 
Example #7
Source File: JmxMBeanServer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <b>Package:</b> Creates an MBeanServer.
 * @param domain The default domain name used by this MBeanServer.
 * @param outer A pointer to the MBeanServer object that must be
 *        passed to the MBeans when invoking their
 *        {@link javax.management.MBeanRegistration} interface.
 * @param delegate A pointer to the MBeanServerDelegate associated
 *        with the new MBeanServer. The new MBeanServer must register
 *        this MBean in its MBean repository.
 * @param instantiator The MBeanInstantiator that will be used to
 *        instantiate MBeans and take care of class loading issues.
 * @param metadata The MetaData object that will be used by the
 *        MBean server in order to invoke the MBean interface of
 *        the registered MBeans.
 * @param interceptors If <code>true</code>,
 *        {@link MBeanServerInterceptor} will be enabled (default is
 *        <code>false</code>).
 * @param fairLock If {@code true}, the MBean repository will use a {@link
 *        java.util.concurrent.locks.ReentrantReadWriteLock#ReentrantReadWriteLock(boolean)
 *        fair locking} policy.
 */
JmxMBeanServer(String domain, MBeanServer outer,
               MBeanServerDelegate    delegate,
               MBeanInstantiator      instantiator,
               boolean                interceptors,
               boolean                fairLock)  {

    if (instantiator == null) {
        final ModifiableClassLoaderRepository
            clr = new ClassLoaderRepositorySupport();
        instantiator = new MBeanInstantiator(clr);
    }

    final MBeanInstantiator fInstantiator = instantiator;
    this.secureClr = new
        SecureClassLoaderRepository(AccessController.doPrivileged(new PrivilegedAction<ClassLoaderRepository>() {
            @Override
            public ClassLoaderRepository run() {
                return fInstantiator.getClassLoaderRepository();
            }
        })
    );
    if (delegate == null)
        delegate = new MBeanServerDelegateImpl();
    if (outer == null)
        outer = this;

    this.instantiator = instantiator;
    this.mBeanServerDelegateObject = delegate;
    this.outerShell   = outer;

    final Repository repository = new Repository(domain);
    this.mbsInterceptor =
        new DefaultMBeanServerInterceptor(outer, delegate, instantiator,
                                          repository);
    this.interceptorsEnabled = interceptors;
    initialize();
}
 
Example #8
Source File: JmxMBeanServer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <b>Package:</b> Creates an MBeanServer.
 * @param domain The default domain name used by this MBeanServer.
 * @param outer A pointer to the MBeanServer object that must be
 *        passed to the MBeans when invoking their
 *        {@link javax.management.MBeanRegistration} interface.
 * @param delegate A pointer to the MBeanServerDelegate associated
 *        with the new MBeanServer. The new MBeanServer must register
 *        this MBean in its MBean repository.
 * @param instantiator The MBeanInstantiator that will be used to
 *        instantiate MBeans and take care of class loading issues.
 * @param metadata The MetaData object that will be used by the
 *        MBean server in order to invoke the MBean interface of
 *        the registered MBeans.
 * @param interceptors If <code>true</code>,
 *        {@link MBeanServerInterceptor} will be enabled (default is
 *        <code>false</code>).
 * @param fairLock If {@code true}, the MBean repository will use a {@link
 *        java.util.concurrent.locks.ReentrantReadWriteLock#ReentrantReadWriteLock(boolean)
 *        fair locking} policy.
 */
JmxMBeanServer(String domain, MBeanServer outer,
               MBeanServerDelegate    delegate,
               MBeanInstantiator      instantiator,
               boolean                interceptors,
               boolean                fairLock)  {

    if (instantiator == null) {
        final ModifiableClassLoaderRepository
            clr = new ClassLoaderRepositorySupport();
        instantiator = new MBeanInstantiator(clr);
    }

    final MBeanInstantiator fInstantiator = instantiator;
    this.secureClr = new
        SecureClassLoaderRepository(AccessController.doPrivileged(new PrivilegedAction<ClassLoaderRepository>() {
            @Override
            public ClassLoaderRepository run() {
                return fInstantiator.getClassLoaderRepository();
            }
        })
    );
    if (delegate == null)
        delegate = new MBeanServerDelegateImpl();
    if (outer == null)
        outer = this;

    this.instantiator = instantiator;
    this.mBeanServerDelegateObject = delegate;
    this.outerShell   = outer;

    final Repository repository = new Repository(domain);
    this.mbsInterceptor =
        new DefaultMBeanServerInterceptor(outer, delegate, instantiator,
                                          repository);
    this.interceptorsEnabled = interceptors;
    initialize();
}
 
Example #9
Source File: JmxMBeanServer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <b>Package:</b> Creates an MBeanServer.
 * @param domain The default domain name used by this MBeanServer.
 * @param outer A pointer to the MBeanServer object that must be
 *        passed to the MBeans when invoking their
 *        {@link javax.management.MBeanRegistration} interface.
 * @param delegate A pointer to the MBeanServerDelegate associated
 *        with the new MBeanServer. The new MBeanServer must register
 *        this MBean in its MBean repository.
 * @param instantiator The MBeanInstantiator that will be used to
 *        instantiate MBeans and take care of class loading issues.
 * @param metadata The MetaData object that will be used by the
 *        MBean server in order to invoke the MBean interface of
 *        the registered MBeans.
 * @param interceptors If <code>true</code>,
 *        {@link MBeanServerInterceptor} will be enabled (default is
 *        <code>false</code>).
 * @param fairLock If {@code true}, the MBean repository will use a {@link
 *        java.util.concurrent.locks.ReentrantReadWriteLock#ReentrantReadWriteLock(boolean)
 *        fair locking} policy.
 */
JmxMBeanServer(String domain, MBeanServer outer,
               MBeanServerDelegate    delegate,
               MBeanInstantiator      instantiator,
               boolean                interceptors,
               boolean                fairLock)  {

    if (instantiator == null) {
        final ModifiableClassLoaderRepository
            clr = new ClassLoaderRepositorySupport();
        instantiator = new MBeanInstantiator(clr);
    }

    final MBeanInstantiator fInstantiator = instantiator;
    this.secureClr = new
        SecureClassLoaderRepository(AccessController.doPrivileged(new PrivilegedAction<ClassLoaderRepository>() {
            @Override
            public ClassLoaderRepository run() {
                return fInstantiator.getClassLoaderRepository();
            }
        })
    );
    if (delegate == null)
        delegate = new MBeanServerDelegateImpl();
    if (outer == null)
        outer = this;

    this.instantiator = instantiator;
    this.mBeanServerDelegateObject = delegate;
    this.outerShell   = outer;

    final Repository repository = new Repository(domain);
    this.mbsInterceptor =
        new DefaultMBeanServerInterceptor(outer, delegate, instantiator,
                                          repository);
    this.interceptorsEnabled = interceptors;
    initialize();
}
 
Example #10
Source File: JmxMBeanServer.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <b>Package:</b> Creates an MBeanServer.
 * @param domain The default domain name used by this MBeanServer.
 * @param outer A pointer to the MBeanServer object that must be
 *        passed to the MBeans when invoking their
 *        {@link javax.management.MBeanRegistration} interface.
 * @param delegate A pointer to the MBeanServerDelegate associated
 *        with the new MBeanServer. The new MBeanServer must register
 *        this MBean in its MBean repository.
 * @param instantiator The MBeanInstantiator that will be used to
 *        instantiate MBeans and take care of class loading issues.
 * @param metadata The MetaData object that will be used by the
 *        MBean server in order to invoke the MBean interface of
 *        the registered MBeans.
 * @param interceptors If <code>true</code>,
 *        {@link MBeanServerInterceptor} will be enabled (default is
 *        <code>false</code>).
 * @param fairLock If {@code true}, the MBean repository will use a {@link
 *        java.util.concurrent.locks.ReentrantReadWriteLock#ReentrantReadWriteLock(boolean)
 *        fair locking} policy.
 */
JmxMBeanServer(String domain, MBeanServer outer,
               MBeanServerDelegate    delegate,
               MBeanInstantiator      instantiator,
               boolean                interceptors,
               boolean                fairLock)  {

    if (instantiator == null) {
        final ModifiableClassLoaderRepository
            clr = new ClassLoaderRepositorySupport();
        instantiator = new MBeanInstantiator(clr);
    }

    final MBeanInstantiator fInstantiator = instantiator;
    this.secureClr = new
        SecureClassLoaderRepository(AccessController.doPrivileged(new PrivilegedAction<ClassLoaderRepository>() {
            @Override
            public ClassLoaderRepository run() {
                return fInstantiator.getClassLoaderRepository();
            }
        })
    );
    if (delegate == null)
        delegate = new MBeanServerDelegateImpl();
    if (outer == null)
        outer = this;

    this.instantiator = instantiator;
    this.mBeanServerDelegateObject = delegate;
    this.outerShell   = outer;

    final Repository repository = new Repository(domain);
    this.mbsInterceptor =
        new DefaultMBeanServerInterceptor(outer, delegate, instantiator,
                                          repository);
    this.interceptorsEnabled = interceptors;
    initialize();
}
 
Example #11
Source File: JmxMBeanServer.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <b>Package:</b> Creates an MBeanServer.
 * @param domain The default domain name used by this MBeanServer.
 * @param outer A pointer to the MBeanServer object that must be
 *        passed to the MBeans when invoking their
 *        {@link javax.management.MBeanRegistration} interface.
 * @param delegate A pointer to the MBeanServerDelegate associated
 *        with the new MBeanServer. The new MBeanServer must register
 *        this MBean in its MBean repository.
 * @param instantiator The MBeanInstantiator that will be used to
 *        instantiate MBeans and take care of class loading issues.
 * @param metadata The MetaData object that will be used by the
 *        MBean server in order to invoke the MBean interface of
 *        the registered MBeans.
 * @param interceptors If <code>true</code>,
 *        {@link MBeanServerInterceptor} will be enabled (default is
 *        <code>false</code>).
 * @param fairLock If {@code true}, the MBean repository will use a {@link
 *        java.util.concurrent.locks.ReentrantReadWriteLock#ReentrantReadWriteLock(boolean)
 *        fair locking} policy.
 */
JmxMBeanServer(String domain, MBeanServer outer,
               MBeanServerDelegate    delegate,
               MBeanInstantiator      instantiator,
               boolean                interceptors,
               boolean                fairLock)  {

    if (instantiator == null) {
        final ModifiableClassLoaderRepository
            clr = new ClassLoaderRepositorySupport();
        instantiator = new MBeanInstantiator(clr);
    }

    final MBeanInstantiator fInstantiator = instantiator;
    this.secureClr = new
        SecureClassLoaderRepository(AccessController.doPrivileged(new PrivilegedAction<ClassLoaderRepository>() {
            @Override
            public ClassLoaderRepository run() {
                return fInstantiator.getClassLoaderRepository();
            }
        })
    );
    if (delegate == null)
        delegate = new MBeanServerDelegateImpl();
    if (outer == null)
        outer = this;

    this.instantiator = instantiator;
    this.mBeanServerDelegateObject = delegate;
    this.outerShell   = outer;

    final Repository repository = new Repository(domain);
    this.mbsInterceptor =
        new DefaultMBeanServerInterceptor(outer, delegate, instantiator,
                                          repository);
    this.interceptorsEnabled = interceptors;
    initialize();
}
 
Example #12
Source File: JmxMBeanServer.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <b>Package:</b> Creates an MBeanServer.
 * @param domain The default domain name used by this MBeanServer.
 * @param outer A pointer to the MBeanServer object that must be
 *        passed to the MBeans when invoking their
 *        {@link javax.management.MBeanRegistration} interface.
 * @param delegate A pointer to the MBeanServerDelegate associated
 *        with the new MBeanServer. The new MBeanServer must register
 *        this MBean in its MBean repository.
 * @param instantiator The MBeanInstantiator that will be used to
 *        instantiate MBeans and take care of class loading issues.
 * @param metadata The MetaData object that will be used by the
 *        MBean server in order to invoke the MBean interface of
 *        the registered MBeans.
 * @param interceptors If <code>true</code>,
 *        {@link MBeanServerInterceptor} will be enabled (default is
 *        <code>false</code>).
 * @param fairLock If {@code true}, the MBean repository will use a {@link
 *        java.util.concurrent.locks.ReentrantReadWriteLock#ReentrantReadWriteLock(boolean)
 *        fair locking} policy.
 */
JmxMBeanServer(String domain, MBeanServer outer,
               MBeanServerDelegate    delegate,
               MBeanInstantiator      instantiator,
               boolean                interceptors,
               boolean                fairLock)  {

    if (instantiator == null) {
        final ModifiableClassLoaderRepository
            clr = new ClassLoaderRepositorySupport();
        instantiator = new MBeanInstantiator(clr);
    }

    final MBeanInstantiator fInstantiator = instantiator;
    this.secureClr = new
        SecureClassLoaderRepository(AccessController.doPrivileged(new PrivilegedAction<ClassLoaderRepository>() {
            @Override
            public ClassLoaderRepository run() {
                return fInstantiator.getClassLoaderRepository();
            }
        })
    );
    if (delegate == null)
        delegate = new MBeanServerDelegateImpl();
    if (outer == null)
        outer = this;

    this.instantiator = instantiator;
    this.mBeanServerDelegateObject = delegate;
    this.outerShell   = outer;

    final Repository repository = new Repository(domain);
    this.mbsInterceptor =
        new DefaultMBeanServerInterceptor(outer, delegate, instantiator,
                                          repository);
    this.interceptorsEnabled = interceptors;
    initialize();
}
 
Example #13
Source File: JmxMBeanServer.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <b>Package:</b> Creates an MBeanServer.
 * @param domain The default domain name used by this MBeanServer.
 * @param outer A pointer to the MBeanServer object that must be
 *        passed to the MBeans when invoking their
 *        {@link javax.management.MBeanRegistration} interface.
 * @param delegate A pointer to the MBeanServerDelegate associated
 *        with the new MBeanServer. The new MBeanServer must register
 *        this MBean in its MBean repository.
 * @param instantiator The MBeanInstantiator that will be used to
 *        instantiate MBeans and take care of class loading issues.
 * @param metadata The MetaData object that will be used by the
 *        MBean server in order to invoke the MBean interface of
 *        the registered MBeans.
 * @param interceptors If <code>true</code>,
 *        {@link MBeanServerInterceptor} will be enabled (default is
 *        <code>false</code>).
 * @param fairLock If {@code true}, the MBean repository will use a {@link
 *        java.util.concurrent.locks.ReentrantReadWriteLock#ReentrantReadWriteLock(boolean)
 *        fair locking} policy.
 */
JmxMBeanServer(String domain, MBeanServer outer,
               MBeanServerDelegate    delegate,
               MBeanInstantiator      instantiator,
               boolean                interceptors,
               boolean                fairLock)  {

    if (instantiator == null) {
        final ModifiableClassLoaderRepository
            clr = new ClassLoaderRepositorySupport();
        instantiator = new MBeanInstantiator(clr);
    }

    final MBeanInstantiator fInstantiator = instantiator;
    this.secureClr = new
        SecureClassLoaderRepository(AccessController.doPrivileged(new PrivilegedAction<ClassLoaderRepository>() {
            @Override
            public ClassLoaderRepository run() {
                return fInstantiator.getClassLoaderRepository();
            }
        })
    );
    if (delegate == null)
        delegate = new MBeanServerDelegateImpl();
    if (outer == null)
        outer = this;

    this.instantiator = instantiator;
    this.mBeanServerDelegateObject = delegate;
    this.outerShell   = outer;

    final Repository repository = new Repository(domain);
    this.mbsInterceptor =
        new DefaultMBeanServerInterceptor(outer, delegate, instantiator,
                                          repository);
    this.interceptorsEnabled = interceptors;
    initialize();
}
 
Example #14
Source File: JmxMBeanServer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <b>Package:</b> Creates an MBeanServer.
 * @param domain The default domain name used by this MBeanServer.
 * @param outer A pointer to the MBeanServer object that must be
 *        passed to the MBeans when invoking their
 *        {@link javax.management.MBeanRegistration} interface.
 * @param delegate A pointer to the MBeanServerDelegate associated
 *        with the new MBeanServer. The new MBeanServer must register
 *        this MBean in its MBean repository.
 * @param instantiator The MBeanInstantiator that will be used to
 *        instantiate MBeans and take care of class loading issues.
 * @param metadata The MetaData object that will be used by the
 *        MBean server in order to invoke the MBean interface of
 *        the registered MBeans.
 * @param interceptors If <code>true</code>,
 *        {@link MBeanServerInterceptor} will be enabled (default is
 *        <code>false</code>).
 * @param fairLock If {@code true}, the MBean repository will use a {@link
 *        java.util.concurrent.locks.ReentrantReadWriteLock#ReentrantReadWriteLock(boolean)
 *        fair locking} policy.
 */
JmxMBeanServer(String domain, MBeanServer outer,
               MBeanServerDelegate    delegate,
               MBeanInstantiator      instantiator,
               boolean                interceptors,
               boolean                fairLock)  {

    if (instantiator == null) {
        final ModifiableClassLoaderRepository
            clr = new ClassLoaderRepositorySupport();
        instantiator = new MBeanInstantiator(clr);
    }

    final MBeanInstantiator fInstantiator = instantiator;
    this.secureClr = new
        SecureClassLoaderRepository(AccessController.doPrivileged(new PrivilegedAction<ClassLoaderRepository>() {
            @Override
            public ClassLoaderRepository run() {
                return fInstantiator.getClassLoaderRepository();
            }
        })
    );
    if (delegate == null)
        delegate = new MBeanServerDelegateImpl();
    if (outer == null)
        outer = this;

    this.instantiator = instantiator;
    this.mBeanServerDelegateObject = delegate;
    this.outerShell   = outer;

    final Repository repository = new Repository(domain);
    this.mbsInterceptor =
        new DefaultMBeanServerInterceptor(outer, delegate, instantiator,
                                          repository);
    this.interceptorsEnabled = interceptors;
    initialize();
}
 
Example #15
Source File: JmxMBeanServer.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <b>Package:</b> Creates an MBeanServer.
 * @param domain The default domain name used by this MBeanServer.
 * @param outer A pointer to the MBeanServer object that must be
 *        passed to the MBeans when invoking their
 *        {@link javax.management.MBeanRegistration} interface.
 * @param delegate A pointer to the MBeanServerDelegate associated
 *        with the new MBeanServer. The new MBeanServer must register
 *        this MBean in its MBean repository.
 * @param instantiator The MBeanInstantiator that will be used to
 *        instantiate MBeans and take care of class loading issues.
 * @param metadata The MetaData object that will be used by the
 *        MBean server in order to invoke the MBean interface of
 *        the registered MBeans.
 * @param interceptors If <code>true</code>,
 *        {@link MBeanServerInterceptor} will be enabled (default is
 *        <code>false</code>).
 * @param fairLock If {@code true}, the MBean repository will use a {@link
 *        java.util.concurrent.locks.ReentrantReadWriteLock#ReentrantReadWriteLock(boolean)
 *        fair locking} policy.
 */
JmxMBeanServer(String domain, MBeanServer outer,
               MBeanServerDelegate    delegate,
               MBeanInstantiator      instantiator,
               boolean                interceptors,
               boolean                fairLock)  {

    if (instantiator == null) {
        final ModifiableClassLoaderRepository
            clr = new ClassLoaderRepositorySupport();
        instantiator = new MBeanInstantiator(clr);
    }

    final MBeanInstantiator fInstantiator = instantiator;
    this.secureClr = new
        SecureClassLoaderRepository(AccessController.doPrivileged(new PrivilegedAction<ClassLoaderRepository>() {
            @Override
            public ClassLoaderRepository run() {
                return fInstantiator.getClassLoaderRepository();
            }
        })
    );
    if (delegate == null)
        delegate = new MBeanServerDelegateImpl();
    if (outer == null)
        outer = this;

    this.instantiator = instantiator;
    this.mBeanServerDelegateObject = delegate;
    this.outerShell   = outer;

    final Repository repository = new Repository(domain);
    this.mbsInterceptor =
        new DefaultMBeanServerInterceptor(outer, delegate, instantiator,
                                          repository);
    this.interceptorsEnabled = interceptors;
    initialize();
}