Package net.sf.basedb.util
Class JarClassLoader.JarClassLoaderProxy
java.lang.Object
net.sf.basedb.util.JarClassLoader.JarClassLoaderProxy
- Enclosing class:
- JarClassLoader
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
Modifier and TypeFieldDescriptionprivate boolean
(package private) final String
private JarClassLoader
-
Constructor Summary
ConstructorDescriptionJarClassLoaderProxy
(String jarPath) Creates a proxy class loader for the given JAR file. -
Method Summary
Modifier and TypeMethodDescription(package private) Class<?>
(package private) URL
findResource
(String name) (package private) Enumeration<URL>
findResources
(String name) (package private) boolean
private void
init()
Initialize the proxy.
-
Field Details
-
jarPath
-
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
-
findResource
-
findResources
-
hasChanged
boolean hasChanged()
-