org.sapia.clazzy
Class CompositeClassLoader
java.lang.Object
|
+--java.lang.ClassLoader
|
+--java.security.SecureClassLoader
|
+--org.sapia.clazzy.BaseClassLoader
|
+--org.sapia.clazzy.CompositeClassLoader
- All Implemented Interfaces:
- Consts
- public class CompositeClassLoader
- extends BaseClassLoader
- implements Consts
This classloader delegates class lookups the Loader instances
that it encapsulates. Children are added through the addLoader()
or addFile method.
The CompositeClassLoaderBuilder can conveniently be used to create
an instance of this class.
- Author:
- Yanick Duchesne
- Copyright:
- Copyright © 2002-2004 Sapia Open
Source Software . All Rights Reserved.
- License:
- Read the license.txt file of the jar or visit the license page at the Sapia
OSS web site
- See Also:
CompositeClassLoaderBuilder
| Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CompositeClassLoader
public CompositeClassLoader(ClassLoader parent,
LoaderSelector selector)
CompositeClassLoader
public CompositeClassLoader(LoaderSelector selector)
getURLs
public URL[] getURLs()
- Returns:
- the URLs to which this instance "points".
findClass
public Class findClass(String name)
throws ClassNotFoundException
- Overrides:
findClass in class ClassLoader
ClassNotFoundException- See Also:
ClassLoader.findClass(java.lang.String)
findResource
protected URL findResource(String name)
- Overrides:
findResource in class ClassLoader
- See Also:
ClassLoader.findResource(java.lang.String)
addLoader
public void addLoader(Loader loader)
- Parameters:
loader - the Loader to add to this instance.
addPath
public void addPath(File file)
- Adds the file object corresponding to a directory of classes or
a jar to this instance.
Internally, the method creates either a FileSystemLoader
(if the given file object corresponds to a directory) or a JarLoader.
- Parameters:
file - a File
close
public void close()
- Releases all resources that this instance.
Copyright © 2002 Sapia Open Community, Inc. All Rights Reserved.