Class ContextClassLoader

  • Direct Known Subclasses:
    ContextClassLoaderSwitcher

    public class ContextClassLoader
    extends java.lang.Object
    A helper for context classloading.

    When a security manager is installed, the constructor checks for the runtime permissions "getClassLoader"

    Version:
    $Revision$
    • Field Detail

      • GETCLASSLOADER

        public static final java.lang.RuntimePermission GETCLASSLOADER
        Retrieve a classloader permission
    • Constructor Detail

      • ContextClassLoader

        ContextClassLoader()
        Constructor.
        Throws:
        java.lang.SecurityException - when not authroized to get the context classloader
    • Method Detail

      • getContextClassLoader

        public java.lang.ClassLoader getContextClassLoader()
        Retrieve the context classloader
        Returns:
        the context classloader
      • getContextClassLoader

        public java.lang.ClassLoader getContextClassLoader​(java.lang.Thread thread)
        Retrieve the context classloader for the given thread
        Parameters:
        thread - the thread
        Returns:
        the context classloader