Class JarClassLoader.JarClassLoaderProxy

java.lang.Object
net.sf.basedb.util.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 Details

    • jarPath

      final String jarPath
    • loader

      private JarClassLoader loader
    • isInitialized

      private boolean isInitialized
  • Constructor Details

    • JarClassLoaderProxy

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

    • init

      private void init()
      Initialize the proxy.
    • findClass

      Class<?> findClass(String name)
    • findResource

      URL findResource(String name)
    • findResources

      Enumeration<URL> findResources(String name)
    • hasChanged

      boolean hasChanged()