org.apache.manifoldcf.core.system
Class ManifoldCFResourceLoader

java.lang.Object
  extended by org.apache.manifoldcf.core.system.ManifoldCFResourceLoader

public class ManifoldCFResourceLoader
extends java.lang.Object

An instance of this class is capable of minting URLClassLoader objects on demand, for the purpose of loading plugins.


Field Summary
static java.lang.String _rcsid
           
protected  java.lang.ClassLoader classLoader
          The class loader we're caching
protected  java.util.ArrayList currentClasspath
          The current 'classpath' - a list of File objects
protected  java.lang.ClassLoader parent
          The parent class loader
 
Constructor Summary
ManifoldCFResourceLoader(java.lang.ClassLoader parent)
          Construct a resource manager.
 
Method Summary
protected  void addDirsToClassPath(java.io.File[] baseList, java.io.FileFilter[] filterList)
          Add fully-resolved directories (with filters) to the current class path.
 void addToClassPath(java.io.File file)
          Add to the class-search path.
 void addToClassPath(java.io.File dir, java.io.FileFilter filter)
          Add to the class-search path.
 void clearClassPath()
          Clear the class-search path.
 java.lang.Class findClass(java.lang.String cname)
          Get the specified class using the proper classloader.
 java.lang.ClassLoader getClassLoader()
          Get the class loader representing this resource loader.
 void setClassPath(java.util.ArrayList libdirList)
          Set the classpath to a given list of libdirs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rcsid

public static final java.lang.String _rcsid
See Also:
Constant Field Values

parent

protected java.lang.ClassLoader parent
The parent class loader


classLoader

protected java.lang.ClassLoader classLoader
The class loader we're caching


currentClasspath

protected java.util.ArrayList currentClasspath
The current 'classpath' - a list of File objects

Constructor Detail

ManifoldCFResourceLoader

public ManifoldCFResourceLoader(java.lang.ClassLoader parent)
                         throws ManifoldCFException
Construct a resource manager.

Parameters:
parent - is the parent class loader.
Throws:
ManifoldCFException
Method Detail

setClassPath

public void setClassPath(java.util.ArrayList libdirList)
                  throws ManifoldCFException
Set the classpath to a given list of libdirs.

Parameters:
libdirList - is an arraylist of File objects, each representing a directory.
Throws:
ManifoldCFException

clearClassPath

public void clearClassPath()
Clear the class-search path.


addToClassPath

public void addToClassPath(java.io.File file)
                    throws ManifoldCFException
Add to the class-search path.

Parameters:
file - is the jar or class root.
Throws:
ManifoldCFException

addToClassPath

public void addToClassPath(java.io.File dir,
                           java.io.FileFilter filter)
                    throws ManifoldCFException
Add to the class-search path.

Parameters:
dir - is the directory to add.
filter - is the file filter to use on that directory.
Throws:
ManifoldCFException

getClassLoader

public java.lang.ClassLoader getClassLoader()
                                     throws ManifoldCFException
Get the class loader representing this resource loader.

Throws:
ManifoldCFException

findClass

public java.lang.Class findClass(java.lang.String cname)
                          throws java.lang.ClassNotFoundException,
                                 ManifoldCFException
Get the specified class using the proper classloader.

Parameters:
cname - is the fully-qualified class name.
Throws:
java.lang.ClassNotFoundException
ManifoldCFException

addDirsToClassPath

protected void addDirsToClassPath(java.io.File[] baseList,
                                  java.io.FileFilter[] filterList)
                           throws ManifoldCFException
Add fully-resolved directories (with filters) to the current class path.

Parameters:
baseList - is the list of library directories.
filterList - is the corresponding list of filters.
Throws:
ManifoldCFException