Class JarClassLoader.JarClassLoaderProxy

  • Enclosing class:
    JarClassLoader

    static class JarClassLoader.JarClassLoaderProxy
    extends Object
    A proxy class loader is typically needed when one extension depends on another extension. The proxy is needed since we want to use lazy initialization of the other class loaders. They may not be needed immediately. The proxy will also make it possible to avoid infinite recursion in case two extensions depend on each other.

    Once a real class loader has been aquired it will be kept until the main class loader is discared. Note that the JarClassLoader.hasChanged(boolean) is not used for automatic reloading since that may cause class-cast exceptions.

    The proxy is also used to limit the search for classes to classes that are directly handled directly by the other class loader. The system and parent class loaders are not searched again since they are already searched in the main class loader.

    Since:
    3.10
    • Field Detail

      • jarPath

        final String jarPath
      • isInitialized

        private boolean isInitialized
    • Constructor Detail

      • JarClassLoaderProxy

        JarClassLoaderProxy​(String jarPath)
        Creates a proxy class loader for the given JAR file.
    • Method Detail

      • init

        private void init()
        Initialize the proxy.
      • findResource

        URL findResource​(String name)
      • hasChanged

        boolean hasChanged()