Package net.sf.jasperreports.engine.util
Class CompositeClassloader
- java.lang.Object
-
- java.lang.ClassLoader
-
- net.sf.jasperreports.engine.util.CompositeClassloader
-
public class CompositeClassloader extends ClassLoader
A composite classloader that has a parent classloader and an alternate classloader.When resolving classes, the parent classloader is consulted first, and if that classloader cannot find the class, the alternate/second classloader is asked to resolve the class.
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Constructor Summary
Constructors Constructor Description CompositeClassloader(ClassLoader parent, ClassLoader fallback)
Creates a composite classloader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Class<?>
findClass(String name)
protected URL
findResource(String name)
-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
-
-
-
Constructor Detail
-
CompositeClassloader
public CompositeClassloader(ClassLoader parent, ClassLoader fallback)
Creates a composite classloader.- Parameters:
parent
- the parent classloaderfallback
- the alternate classloader
-
-
Method Detail
-
findClass
protected Class<?> findClass(String name) throws ClassNotFoundException
- Overrides:
findClass
in classClassLoader
- Throws:
ClassNotFoundException
-
findResource
protected URL findResource(String name)
- Overrides:
findResource
in classClassLoader
-
-