Class FakeURLClassLoader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class FakeURLClassLoader
    extends java.net.URLClassLoader
    FakeURLClassLoader

    A URLClassloader that overrides the getURLs() method to return the list of urls passed in to the constructor, but otherwise acts as if it has no urls, which would cause it to delegate to the parent classloader (in this case an OSGi classloader).

    The main use of this class is with jars containing tlds. Jasper expects a URL classloader to inspect for jars with tlds.

    • Constructor Summary

      Constructors 
      Constructor Description
      FakeURLClassLoader​(java.lang.ClassLoader osgiClassLoader, java.net.URL[] jars)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.URL[] getURLs()  
      java.lang.String toString()  
      • Methods inherited from class java.net.URLClassLoader

        addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, newInstance, newInstance
      • Methods inherited from class java.security.SecureClassLoader

        defineClass, defineClass
      • Methods inherited from class java.lang.ClassLoader

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

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

      • FakeURLClassLoader

        public FakeURLClassLoader​(java.lang.ClassLoader osgiClassLoader,
                                  java.net.URL[] jars)
    • Method Detail

      • getURLs

        public java.net.URL[] getURLs()
        Overrides:
        getURLs in class java.net.URLClassLoader
        Returns:
        the jars that contains tlds so that TldLocationsCache or TldScanner can find them.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()