Package net.sf.basedb.util
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 Summary
Fields Modifier and Type Field Description private boolean
isInitialized
(package private) String
jarPath
private JarClassLoader
loader
-
Constructor Summary
Constructors Constructor Description JarClassLoaderProxy(String jarPath)
Creates a proxy class loader for the given JAR file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) Class<?>
findClass(String name)
(package private) URL
findResource(String name)
(package private) Enumeration<URL>
findResources(String name)
(package private) boolean
hasChanged()
private void
init()
Initialize the proxy.
-
-
-
Field Detail
-
jarPath
final String jarPath
-
loader
private JarClassLoader loader
-
isInitialized
private boolean isInitialized
-
-
Constructor Detail
-
JarClassLoaderProxy
JarClassLoaderProxy(String jarPath)
Creates a proxy class loader for the given JAR file.
-
-