Package com.sun.jmx.mbeanserver

Examples of com.sun.jmx.mbeanserver.ModifiableClassLoaderRepository


     * @param loader       The ClassLoader.
     * @param logicalName  The ClassLoader MBean ObjectName.
     */
    private void addClassLoader(ClassLoader loader,
            final ObjectName logicalName) {
        /**
         * Called when the newly registered MBean is a ClassLoader
         * If so, tell the ClassLoaderRepository (CLR) about it.  We do
         * this even if the loader is a PrivateClassLoader.  In that
         * case, the CLR remembers the loader for use when it is
         * explicitly named (e.g. as the loader in createMBean) but
         * does not add it to the list that is consulted by
         * ClassLoaderRepository.loadClass.
         */
        final ModifiableClassLoaderRepository clr = getInstantiatorCLR();
        if (clr == null) {
            final RuntimeException wrapped =
                    new IllegalArgumentException(
                    "Dynamic addition of class loaders" +
                    " is not supported");
            throw new RuntimeOperationsException(wrapped,
                    "Exception occurred trying to register" +
                    " the MBean as a class loader");
        }
        clr.addClassLoader(logicalName, loader);
    }
View Full Code Here


            final ObjectName logicalName) {
        /**
         * Removes the  MBean from the default loader repository.
         */
        if (loader != server.getClass().getClassLoader()) {
            final ModifiableClassLoaderRepository clr = getInstantiatorCLR();
            if (clr != null) {
                clr.removeClassLoader(logicalName);
            }
        }
    }
View Full Code Here

     * @param loader       The ClassLoader.
     * @param logicalName  The ClassLoader MBean ObjectName.
     */
    private void addClassLoader(ClassLoader loader,
            final ObjectName logicalName) {
        /**
         * Called when the newly registered MBean is a ClassLoader
         * If so, tell the ClassLoaderRepository (CLR) about it.  We do
         * this even if the loader is a PrivateClassLoader.  In that
         * case, the CLR remembers the loader for use when it is
         * explicitly named (e.g. as the loader in createMBean) but
         * does not add it to the list that is consulted by
         * ClassLoaderRepository.loadClass.
         */
        final ModifiableClassLoaderRepository clr =
                instantiator.getClassLoaderRepository();
        if (clr == null) {
            final RuntimeException wrapped =
                    new IllegalArgumentException(
                    "Dynamic addition of class loaders" +
                    " is not supported");
            throw new RuntimeOperationsException(wrapped,
                    "Exception occurred trying to register" +
                    " the MBean as a class loader");
        }
        clr.addClassLoader(logicalName, loader);
    }
View Full Code Here

            final ObjectName logicalName) {
        /**
         * Removes the  MBean from the default loader repository.
         */
        if (loader != server.getClass().getClassLoader()) {
            final ModifiableClassLoaderRepository clr =
                    instantiator.getClassLoaderRepository();
            if (clr != null) {
                clr.removeClassLoader(logicalName);
            }
        }
    }
View Full Code Here

         */

        Object resource = getResource(instance);
        if (resource instanceof ClassLoader
            && resource != server.getClass().getClassLoader()) {
            final ModifiableClassLoaderRepository clr =
                instantiator.getClassLoaderRepository();
            if (clr != null) clr.removeClassLoader(name);
        }

        // ---------------------
        // Send deletion event
        // ---------------------
View Full Code Here

         * does not add it to the list that is consulted by
         * ClassLoaderRepository.loadClass.
         */
        final Object resource = getResource(mbean);
        if (resource instanceof ClassLoader) {
            final ModifiableClassLoaderRepository clr =
                instantiator.getClassLoaderRepository();
            if (clr == null) {
                final RuntimeException wrapped =
                    new IllegalArgumentException(
                     "Dynamic addition of class loaders is not supported");
                throw new RuntimeOperationsException(wrapped,
           "Exception occurred trying to register the MBean as a class loader");
            }
            clr.addClassLoader(logicalName, (ClassLoader) resource);
        }

        return result;
    }
View Full Code Here

TOP

Related Classes of com.sun.jmx.mbeanserver.ModifiableClassLoaderRepository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.