< prev index next >

src/java.management/share/classes/com/sun/jmx/remote/util/EnvHelp.java

Print this page




 160                 ObjectName.class.getName() + " : " +
 161                 name.getClass().getName();
 162             throw new IllegalArgumentException(msg);
 163         }
 164 
 165         if (mbs == null)
 166             throw new IllegalArgumentException("Null MBeanServer object");
 167 
 168         return mbs.getClassLoader(on);
 169     }
 170 
 171     /**
 172      * Get the Connector Client default class loader.
 173      * <p>
 174      * Returns:
 175      * <ul>
 176      * <li>
 177      *     The ClassLoader object found in <var>env</var> for
 178      *     <code>jmx.remote.default.class.loader</code>, if any.
 179      * </li>
 180      * <li>The <tt>Thread.currentThread().getContextClassLoader()</tt>
 181      *     otherwise.
 182      * </li>
 183      * </ul>
 184      * <p>
 185      * Usually a Connector Client will call
 186      * <pre>
 187      * ClassLoader dcl = EnvHelp.resolveClientClassLoader(env);
 188      * </pre>
 189      * in its <code>connect(Map env)</code> method.
 190      *
 191      * @return The connector client default class loader.
 192      *
 193      * @exception IllegalArgumentException if
 194      * <code>jmx.remote.default.class.loader</code> is specified
 195      * and is not an instance of {@link ClassLoader}.
 196      */
 197     public static ClassLoader resolveClientClassLoader(Map<String, ?> env) {
 198 
 199         if (env == null)
 200             return Thread.currentThread().getContextClassLoader();




 160                 ObjectName.class.getName() + " : " +
 161                 name.getClass().getName();
 162             throw new IllegalArgumentException(msg);
 163         }
 164 
 165         if (mbs == null)
 166             throw new IllegalArgumentException("Null MBeanServer object");
 167 
 168         return mbs.getClassLoader(on);
 169     }
 170 
 171     /**
 172      * Get the Connector Client default class loader.
 173      * <p>
 174      * Returns:
 175      * <ul>
 176      * <li>
 177      *     The ClassLoader object found in <var>env</var> for
 178      *     <code>jmx.remote.default.class.loader</code>, if any.
 179      * </li>
 180      * <li>The {@code Thread.currentThread().getContextClassLoader()}
 181      *     otherwise.
 182      * </li>
 183      * </ul>
 184      * <p>
 185      * Usually a Connector Client will call
 186      * <pre>
 187      * ClassLoader dcl = EnvHelp.resolveClientClassLoader(env);
 188      * </pre>
 189      * in its <code>connect(Map env)</code> method.
 190      *
 191      * @return The connector client default class loader.
 192      *
 193      * @exception IllegalArgumentException if
 194      * <code>jmx.remote.default.class.loader</code> is specified
 195      * and is not an instance of {@link ClassLoader}.
 196      */
 197     public static ClassLoader resolveClientClassLoader(Map<String, ?> env) {
 198 
 199         if (env == null)
 200             return Thread.currentThread().getContextClassLoader();


< prev index next >