com.caucho.loader
Class LibraryLoader

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

@Configurable
public class LibraryLoader
extends JarListLoader

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
LibraryLoader()
          Creates a new directory loader.
LibraryLoader(java.lang.ClassLoader loader)
           
LibraryLoader(java.lang.ClassLoader loader, Path path)
          Creates a new directory loader.
 
Method Summary
static DynamicClassLoader create(java.lang.ClassLoader parent, Path path)
          Create a new class loader
protected  void destroy()
          Destroys the loader, closing the jars.
 Path getCodePath()
           
 Path getPath()
          The library loader's path.
 void init()
          Initialize
 boolean isModified()
          True if any of the loaded classes have been modified.
 boolean logModified(java.util.logging.Logger log)
          True if the classes in the directory have changed.
 void setFileset(FileSetType fileSet)
          Sets a file set.
 void setPath(Path path)
          The library loader's path.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.loader.JarListLoader
addJar, buildClassPath, clearJars, getClassEntry, getPath, getResources, isJarCacheEnabled, 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
 

Constructor Detail

LibraryLoader

public LibraryLoader()
Creates a new directory loader.


LibraryLoader

public LibraryLoader(java.lang.ClassLoader loader)

LibraryLoader

public LibraryLoader(java.lang.ClassLoader loader,
                     Path path)
Creates a new directory loader.

Method Detail

setPath

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


getPath

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


setFileset

public void setFileset(FileSetType fileSet)
Sets a file set.


create

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

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

init

@PostConstruct
public void init()
          throws ConfigException
Initialize

Overrides:
init in class JarListLoader
Throws:
ConfigException

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
Overrides:
isModified 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