com.caucho.loader
Class JarListLoader

java.lang.Object
  extended by com.caucho.loader.Loader
      extended by com.caucho.loader.JarListLoader
All Implemented Interfaces:
Dependency
Direct Known Subclasses:
IvyLoader, JarLoader, LibraryLoader, TreeLoader

public abstract class JarListLoader
extends Loader
implements Dependency

Class loader which checks for changes in class files and automatically picks up new jars.


Field Summary
protected  java.util.ArrayList<com.caucho.loader.JarEntry> _jarList
           
 
Constructor Summary
JarListLoader()
          Creates a new jar list loader.
JarListLoader(java.lang.ClassLoader loader)
           
 
Method Summary
protected  void addJar(Path jar)
           
protected  void buildClassPath(java.util.ArrayList<java.lang.String> pathList)
          Fill data for the class path.
protected  void clearJars()
          Closes the jars.
protected  ClassEntry getClassEntry(java.lang.String name, java.lang.String pathName)
          Returns the class entry.
 Path getPath(java.lang.String pathName)
          Find a given path somewhere in the classpath
 void getResources(java.util.Vector<java.net.URL> vector, java.lang.String name)
          Adds resources to the enumeration.
 void init()
          Initialize the loader
protected  boolean isJarCacheEnabled()
           
 boolean isModified()
          True if any of the loaded classes have been modified.
 boolean logModified(java.util.logging.Logger log)
          True if any of the loaded classes have been modified.
 void setLoader(DynamicClassLoader loader)
          Sets the owning class loader.
 java.lang.String toString()
           
 void validate()
          Validates the loader.
 
Methods inherited from class com.caucho.loader.Loader
buildSourcePath, destroy, getClassLoader, getCodeSource, getResource, getResourceAsStream, isDirectoryLoader, loadClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_jarList

protected java.util.ArrayList<com.caucho.loader.JarEntry> _jarList
Constructor Detail

JarListLoader

public JarListLoader()
Creates a new jar list loader.


JarListLoader

public JarListLoader(java.lang.ClassLoader loader)
Method Detail

setLoader

public void setLoader(DynamicClassLoader loader)
Sets the owning class loader.

Overrides:
setLoader in class Loader

isModified

public boolean isModified()
True if any of the loaded classes have been modified. If true, the caller should drop the classpath and create a new one.

Specified by:
isModified in interface Dependency

logModified

public boolean logModified(java.util.logging.Logger log)
True if any of the loaded classes have been modified. If true, the caller should drop the classpath and create a new one.

Specified by:
logModified in interface Dependency

validate

public void validate()
              throws ConfigException
Validates the loader.

Overrides:
validate in class Loader
Throws:
ConfigException

init

public void init()
Description copied from class: Loader
Initialize the loader

Overrides:
init in class Loader

isJarCacheEnabled

protected boolean isJarCacheEnabled()

addJar

protected void addJar(Path jar)

buildClassPath

protected void buildClassPath(java.util.ArrayList<java.lang.String> pathList)
Fill data for the class path. fillClassPath() will add all .jar and .zip files in the directory list.

Overrides:
buildClassPath in class Loader

getClassEntry

protected ClassEntry getClassEntry(java.lang.String name,
                                   java.lang.String pathName)
                            throws java.lang.ClassNotFoundException
Returns the class entry.

Overrides:
getClassEntry in class Loader
Parameters:
name - name of the class
Throws:
java.lang.ClassNotFoundException

getResources

public void getResources(java.util.Vector<java.net.URL> vector,
                         java.lang.String name)
Adds resources to the enumeration.

Overrides:
getResources in class Loader
name - name of the resource

getPath

public Path getPath(java.lang.String pathName)
Find a given path somewhere in the classpath

Overrides:
getPath in class Loader
Parameters:
pathName - the relative resourceName
Returns:
the matching path or null

clearJars

protected void clearJars()
Closes the jars.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object