org.openorb.util.launcher
Class LibraryClassLoader
java.lang.Object
|
+--java.lang.ClassLoader
|
+--java.security.SecureClassLoader
|
+--java.net.URLClassLoader
|
+--org.openorb.util.launcher.LibraryClassLoader
- Direct Known Subclasses:
- ProjectClassLoader
- public class LibraryClassLoader
- extends URLClassLoader
A generic class loader using directory scans to add libraries to
th class path.
- Version:
- $Revision: 1.5 $ $Date: 2004/02/03 23:25:32 $
- Author:
- Richard G Clark
| Methods inherited from class java.lang.ClassLoader |
defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setSigners |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ACCEPT_ALL_FILE_FILTER
public static final FileFilter ACCEPT_ALL_FILE_FILTER
- A
FileFilter that accepts any file.
REJECT_ALL_FILE_FILTER
public static final FileFilter REJECT_ALL_FILE_FILTER
- A
FileFilter that accepts no file.
JAR_FILE_FILTER
public static final FileFilter JAR_FILE_FILTER
- A
FileFilter that accepts any file with.
LibraryClassLoader
public LibraryClassLoader(File[] roots,
FileFilter libraryFilter,
FileFilter recursiveFilter,
boolean dynamicRescan)
- Constructs this to search the specified roots for libraries matching
the filter.
- Parameters:
roots - the root files to searchlibraryFilter - used to identify library filesrecursiveFilter - used to determine which directories to
recursively traversedynamicRescan - indicates if the roots should be rescanned if a
class could not be found
LibraryClassLoader
public LibraryClassLoader(File[] roots,
ClassLoader parent,
FileFilter libraryFilter,
FileFilter recursiveFilter,
boolean dynamicRescan)
- Constructs this to search the specified roots for libraries matching
the filter.
- Parameters:
roots - the root files to searchparent - the parent class loader to uselibraryFilter - used to identify library filesrecursiveFilter - used to determine which directories to
recursively traversedynamicRescan - indicates if the roots should be rescanned if a
class could not be found
findClass
protected Class findClass(String className)
throws ClassNotFoundException
- Finds the specified class. If dynamic scanning is enabled then the
roots will be rescanned before throwing an exception.
- Overrides:
findClass in class URLClassLoader
- Parameters:
className - the name of the class- Returns:
- the resulting
Class object - Throws:
ClassNotFoundException - if the class could not be found