com.caucho.loader
Class TreeLoader

java.lang.Object
  extended by com.caucho.loader.Loader
      extended by com.caucho.loader.JarListLoader
          extended by com.caucho.loader.TreeLoader
All Implemented Interfaces:
Dependency

@Configurable
public class TreeLoader
extends JarListLoader
implements Dependency

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


Field Summary
 
Fields inherited from class com.caucho.loader.JarListLoader
_jarList
 
Constructor Summary
TreeLoader()
          Creates a new directory loader.
TreeLoader(java.lang.ClassLoader loader)
          Creates a new directory loader.
TreeLoader(java.lang.ClassLoader loader, Path dir)
          Creates a new directory loader.
 
Method Summary
static DynamicClassLoader create(java.lang.ClassLoader parent, Path dir)
          Create a new class loader
protected  void destroy()
          Destroys the loader, closing the jars.
 Path getCodePath()
           
 Path getPath()
          The directory loader's path.
 void init()
          Initialize
 boolean logModified(java.util.logging.Logger log)
          True if the classes in the directory have changed.
 void setPath(Path path)
          The directory loader's path.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.loader.JarListLoader
addJar, buildClassPath, clearJars, getClassEntry, getPath, getResources, isJarCacheEnabled, isModified, setLoader, validate
 
Methods inherited from class com.caucho.loader.Loader
buildSourcePath, getClassLoader, getCodeSource, getResource, getResourceAsStream, isDirectoryLoader, loadClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.caucho.vfs.Dependency
isModified
 

Constructor Detail

TreeLoader

public TreeLoader()
Creates a new directory loader.


TreeLoader

public TreeLoader(java.lang.ClassLoader loader)
Creates a new directory loader.


TreeLoader

public TreeLoader(java.lang.ClassLoader loader,
                  Path dir)
Creates a new directory loader.

Method Detail

setPath

public void setPath(Path path)
The directory loader's path.


getPath

public Path getPath()
The directory loader's path.


create

public static DynamicClassLoader create(java.lang.ClassLoader parent,
                                        Path dir)
Create a new class loader

Parameters:
parent - parent class loader
dir - directories which can handle dynamic jar addition

init

@PostConstruct
public void init()
Initialize

Overrides:
init in class JarListLoader

logModified

public boolean logModified(java.util.logging.Logger log)
True if the classes in the directory have changed.

Specified by:
logModified in interface Dependency
Overrides:
logModified in class JarListLoader

getCodePath

public Path getCodePath()

destroy

protected void destroy()
Destroys the loader, closing the jars.

Overrides:
destroy in class Loader

toString

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