org.openorb.util
Class URLLoader

java.lang.Object
  |
  +--java.lang.ClassLoader
        |
        +--org.openorb.util.URLLoader

public class URLLoader
extends ClassLoader

This class is used as a class loader to load class from an URL.

Version:
$Revision: 1.2 $ $Date: 2004/02/10 21:28:45 $
Author:
Jerome Daniel

Constructor Summary
URLLoader(URL[] urls)
          Constructor.
 
Method Summary
protected  Class findClass(String name)
          This function is used to find a class from an URL.
 URL[] getURLs()
          Return the url array.
protected  Class loadClass(String name, boolean resolve)
          Try different ways to load a class.
 
Methods inherited from class java.lang.ClassLoader
defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLLoader

public URLLoader(URL[] urls)
Constructor.
Parameters:
urls - The list of urls to load classes from.
Method Detail

getURLs

public URL[] getURLs()
Return the url array.
Returns:
The array of URLs to load classes from.

loadClass

protected Class loadClass(String name,
                          boolean resolve)
                   throws ClassNotFoundException
Try different ways to load a class.
Overrides:
loadClass in class ClassLoader
Parameters:
name - The name of the class to load.
resolve - When true try to resolve the class.
Returns:
The class if one was found.
Throws:
ClassNotFoundException - When the class can't be found either via the current class loader or the system class loader.

findClass

protected Class findClass(String name)
This function is used to find a class from an URL.
Overrides:
findClass in class ClassLoader
Parameters:
name - The class to find
Returns:
The class if found.