com.caucho.loader
Class Loader

java.lang.Object
  extended by com.caucho.loader.Loader
Direct Known Subclasses:
CompilingLoader, JarListLoader, PathLoader, ResourceLoader, SimpleLoader

public abstract class Loader
extends java.lang.Object

Loads resources.


Field Summary
protected static java.util.logging.Logger log
           
 
Constructor Summary
protected Loader()
           
protected Loader(java.lang.ClassLoader loader)
           
 
Method Summary
protected  void buildClassPath(java.util.ArrayList<java.lang.String> pathList)
          Adds the sourcepath of this loader.
protected  void buildSourcePath(java.util.ArrayList<java.lang.String> pathList)
          Adds the sourcepath of this loader.
protected  void destroy()
          Destroys the loader.
protected  ClassEntry getClassEntry(java.lang.String name, java.lang.String pathName)
          Returns the class entry.
 DynamicClassLoader getClassLoader()
          Gets the owning class loader.
protected  java.security.CodeSource getCodeSource(Path path)
          Returns the code source for the path.
 Path getPath(java.lang.String name)
          Returns a path for the given name.
 java.net.URL getResource(java.lang.String name)
          Returns the resource
 java.io.InputStream getResourceAsStream(java.lang.String name)
          Opens the stream to the resource.
 void getResources(java.util.Vector<java.net.URL> resources, java.lang.String name)
          Returns the resource
 void init()
          Initialize the loader
 boolean isDirectoryLoader()
           
protected  java.lang.Class<?> loadClass(java.lang.String name)
          Loads the class directly, e.g.
 void setLoader(DynamicClassLoader loader)
          Sets the owning class loader.
 void validate()
          Validates the loader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final java.util.logging.Logger log
Constructor Detail

Loader

protected Loader()

Loader

protected Loader(java.lang.ClassLoader loader)
Method Detail

isDirectoryLoader

public boolean isDirectoryLoader()

setLoader

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


getClassLoader

public DynamicClassLoader getClassLoader()
Gets the owning class loader.


validate

public void validate()
              throws ConfigException
Validates the loader.

Throws:
ConfigException

init

@PostConstruct
public void init()
Initialize the loader


loadClass

protected java.lang.Class<?> loadClass(java.lang.String name)
Loads the class directly, e.g. from OSGi


getClassEntry

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

Parameters:
name - name of the class
Throws:
java.lang.ClassNotFoundException

getResource

public java.net.URL getResource(java.lang.String name)
Returns the resource

Parameters:
name - name of the resource

getResources

public void getResources(java.util.Vector<java.net.URL> resources,
                         java.lang.String name)
Returns the resource

Parameters:
name - name of the resource

getResourceAsStream

public java.io.InputStream getResourceAsStream(java.lang.String name)
Opens the stream to the resource.

Parameters:
name - name of the resource

getPath

public Path getPath(java.lang.String name)
Returns a path for the given name.


getCodeSource

protected java.security.CodeSource getCodeSource(Path path)
Returns the code source for the path.


buildClassPath

protected void buildClassPath(java.util.ArrayList<java.lang.String> pathList)
Adds the sourcepath of this loader.


buildSourcePath

protected void buildSourcePath(java.util.ArrayList<java.lang.String> pathList)
Adds the sourcepath of this loader.


destroy

protected void destroy()
Destroys the loader.