org.apache.cocoon.components.classloader
Class RepositoryClassLoader

java.lang.Object
  |
  +--java.lang.ClassLoader
        |
        +--java.security.SecureClassLoader
              |
              +--java.net.URLClassLoader
                    |
                    +--org.apache.cocoon.components.classloader.RepositoryClassLoader
All Implemented Interfaces:
org.apache.avalon.framework.logger.Loggable

public class RepositoryClassLoader
extends java.net.URLClassLoader
implements org.apache.avalon.framework.logger.Loggable

A class loader with a growable list of path search directories. BL: Changed to extend URLClassLoader for both maintenance and compatibility reasons. It doesn't hurt that it runs quicker now as well.

Version:
CVS $Id: RepositoryClassLoader.java,v 1.6 2002/03/01 14:31:22 vgritsenko Exp $
Author:
Ricardo Rocha, Berin Loritsch

Field Summary
protected  org.apache.log.Logger log
          The logger
 
Constructor Summary
  RepositoryClassLoader()
          Create an empty new class loader.
  RepositoryClassLoader(java.net.URL[] urls)
          Create an empty new class loader.
  RepositoryClassLoader(java.net.URL[] urls, java.lang.ClassLoader parentClassLoader)
          Create an empty new class loader.
protected RepositoryClassLoader(java.util.Vector repositories)
          Create a class loader from a list of directories
 
Method Summary
 void addDirectory(java.io.File repository)
          Add a directory to the list of searchable repositories.
 void addDirectory(java.lang.String repository)
          Add a directory to the list of searchable repositories.
 void addURL(java.net.URL url)
          Add a url to the list of searchable repositories
 java.lang.Class defineClass(byte[] b)
          Create a Class from a byte array
 void setLogger(org.apache.log.Logger logger)
           
 
Methods inherited from class java.net.URLClassLoader
definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass
 
Methods inherited from class java.lang.ClassLoader
defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.log.Logger log
The logger
Constructor Detail

RepositoryClassLoader

public RepositoryClassLoader()
Create an empty new class loader.

RepositoryClassLoader

public RepositoryClassLoader(java.net.URL[] urls)
Create an empty new class loader.

RepositoryClassLoader

public RepositoryClassLoader(java.net.URL[] urls,
                             java.lang.ClassLoader parentClassLoader)
Create an empty new class loader.

RepositoryClassLoader

protected RepositoryClassLoader(java.util.Vector repositories)
Create a class loader from a list of directories
Parameters:
repositories - List of searchable directories
Method Detail

setLogger

public void setLogger(org.apache.log.Logger logger)
Specified by:
setLogger in interface org.apache.avalon.framework.logger.Loggable

addDirectory

public void addDirectory(java.io.File repository)
                  throws java.io.IOException
Add a directory to the list of searchable repositories. This methods ensures that no directory is specified more than once.
Parameters:
repository - The directory path
Throws:
java.io.IOException - Non-existent, non-readable or non-directory repository

addDirectory

public void addDirectory(java.lang.String repository)
                  throws java.io.IOException
Add a directory to the list of searchable repositories. This methods ensures that no directory is specified more than once.
Parameters:
repository - The directory path
Throws:
java.io.IOException - Non-existent, non-readable or non-directory repository

addURL

public void addURL(java.net.URL url)
Add a url to the list of searchable repositories
Overrides:
addURL in class java.net.URLClassLoader

defineClass

public java.lang.Class defineClass(byte[] b)
                            throws java.lang.ClassFormatError
Create a Class from a byte array


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.