Class JRClassLoader

  • Direct Known Subclasses:
    CompiledClassesLoader

    public class JRClassLoader
    extends java.lang.ClassLoader
    Author:
    Teodor Danciu (teodord@users.sourceforge.net)
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getClassRealName​(java.lang.String className)  
      protected java.security.ProtectionDomain getProtectionDomain()  
      static ProtectionDomainFactory getProtectionDomainFactory()  
      protected java.lang.Class<?> loadClass​(java.lang.String name, boolean resolve)  
      protected java.lang.Class<?> loadClass​(java.lang.String className, byte[] bytecodes)  
      protected java.lang.Class<?> loadClass​(java.lang.String className, java.io.File file)  
      static java.lang.Class<?> loadClassForName​(java.lang.String className)  
      static java.lang.Class<?> loadClassForRealName​(java.lang.String className)  
      static java.lang.Class<?> loadClassFromBytes​(java.lang.String className, byte[] bytecodes)  
      static java.lang.Class<?> loadClassFromBytes​(ClassLoaderFilter classLoaderFilter, java.lang.String className, byte[] bytecodes)  
      static java.lang.Class<?> loadClassFromBytes​(ClassLoaderFilter classLoaderFilter, java.lang.String className, CompiledClasses compiledClasses)  
      static java.lang.Class<?> loadClassFromFile​(java.lang.String className, java.io.File file)  
      static void setProtectionDomain​(java.security.ProtectionDomain protectionDomain)
      Sets the protection to be used for classes loaded via the loadClassFromBytes method.
      static void setProtectionDomainFactory​(ProtectionDomainFactory protectionDomainFactory)
      Sets a protection domain factory to be used for creating protection domains for the classes loaded by instances of this class.
      • Methods inherited from class java.lang.ClassLoader

        clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JRClassLoader

        protected JRClassLoader()
      • JRClassLoader

        protected JRClassLoader​(java.lang.ClassLoader parent)
      • JRClassLoader

        protected JRClassLoader​(java.lang.ClassLoader parent,
                                ClassLoaderFilter classLoaderFilter)
    • Method Detail

      • setProtectionDomain

        public static void setProtectionDomain​(java.security.ProtectionDomain protectionDomain)
        Sets the protection to be used for classes loaded via the loadClassFromBytes method. By default, the protection domain of this class is used for the loaded classes.
        Parameters:
        protectionDomain - the protection domain to be used
        See Also:
        loadClassFromBytes(String, byte[])
      • setProtectionDomainFactory

        public static void setProtectionDomainFactory​(ProtectionDomainFactory protectionDomainFactory)
        Sets a protection domain factory to be used for creating protection domains for the classes loaded by instances of this class.

        For every instance of this class, getProtectionDomain is called and the resulting protection domain is used when loading classes through the newly created classloader.

        Parameters:
        protectionDomainFactory - the protection domain factory.
        See Also:
        ProtectionDomainFactory.getProtectionDomain(ClassLoader)
      • loadClassForName

        public static java.lang.Class<?> loadClassForName​(java.lang.String className)
                                                   throws java.lang.ClassNotFoundException
        Throws:
        java.lang.ClassNotFoundException
      • loadClassForRealName

        public static java.lang.Class<?> loadClassForRealName​(java.lang.String className)
                                                       throws java.lang.ClassNotFoundException
        Throws:
        java.lang.ClassNotFoundException
      • loadClassFromFile

        public static java.lang.Class<?> loadClassFromFile​(java.lang.String className,
                                                           java.io.File file)
                                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • loadClassFromBytes

        public static java.lang.Class<?> loadClassFromBytes​(java.lang.String className,
                                                            byte[] bytecodes)
      • loadClassFromBytes

        public static java.lang.Class<?> loadClassFromBytes​(ClassLoaderFilter classLoaderFilter,
                                                            java.lang.String className,
                                                            byte[] bytecodes)
      • loadClassFromBytes

        public static java.lang.Class<?> loadClassFromBytes​(ClassLoaderFilter classLoaderFilter,
                                                            java.lang.String className,
                                                            CompiledClasses compiledClasses)
      • loadClass

        protected java.lang.Class<?> loadClass​(java.lang.String className,
                                               java.io.File file)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • getProtectionDomain

        protected java.security.ProtectionDomain getProtectionDomain()
      • loadClass

        protected java.lang.Class<?> loadClass​(java.lang.String className,
                                               byte[] bytecodes)
      • loadClass

        protected java.lang.Class<?> loadClass​(java.lang.String name,
                                               boolean resolve)
                                        throws java.lang.ClassNotFoundException,
                                               JRRuntimeException
        Overrides:
        loadClass in class java.lang.ClassLoader
        Throws:
        java.lang.ClassNotFoundException
        JRRuntimeException
      • getClassRealName

        public static java.lang.String getClassRealName​(java.lang.String className)