org.codehaus.classworlds
Class RealmClassLoader

java.lang.Object
  extended byjava.lang.ClassLoader
      extended byjava.security.SecureClassLoader
          extended byjava.net.URLClassLoader
              extended byorg.codehaus.classworlds.RealmClassLoader
Direct Known Subclasses:
UberJarRealmClassLoader

class RealmClassLoader
extends java.net.URLClassLoader

Classloader for ClassRealms.

Version:
$Id: RealmClassLoader.java,v 1.3 2003/09/23 14:09:46 jvanzyl Exp $
Author:
bob mcwhirter

Nested Class Summary
 
Nested classes inherited from class java.lang.ClassLoader
 
Field Summary
protected  DefaultClassRealm realm
          The realm.
 
Fields inherited from class java.net.URLClassLoader
 
Fields inherited from class java.security.SecureClassLoader
 
Fields inherited from class java.lang.ClassLoader
 
Constructor Summary
(package private) RealmClassLoader(DefaultClassRealm realm)
          Construct.
 
Method Summary
(package private)  void addConstituent(java.net.URL constituent)
          Add a constituent to this realm for locating classes.
 java.net.URL findResource(java.lang.String name)
           
(package private)  DefaultClassRealm getRealm()
          Retrieve the realm.
 java.net.URL[] getURLs()
          Retrieve the URLs used by this ClassLoader.
protected  java.lang.Class loadClass(java.lang.String name, boolean resolve)
          Load a class.
(package private)  java.lang.Class loadClassDirect(java.lang.String name)
          Load a class directly from this classloader without defering through any other ClassRealm.
 
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findClass, findResources, getPermissions, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

realm

protected DefaultClassRealm realm
The realm.

Constructor Detail

RealmClassLoader

RealmClassLoader(DefaultClassRealm realm)
Construct.

Parameters:
realm - The realm for which this loads.
Method Detail

getRealm

DefaultClassRealm getRealm()
Retrieve the realm.

Returns:
The realm.

addConstituent

void addConstituent(java.net.URL constituent)
Add a constituent to this realm for locating classes.

Parameters:
constituent - URL to contituent jar or directory.

loadClassDirect

java.lang.Class loadClassDirect(java.lang.String name)
                          throws java.lang.ClassNotFoundException
Load a class directly from this classloader without defering through any other ClassRealm.

Parameters:
name - The name of the class to load.
Returns:
The loaded class.
Throws:
java.lang.ClassNotFoundException - If the class could not be found.

loadClass

protected java.lang.Class loadClass(java.lang.String name,
                                    boolean resolve)
                             throws java.lang.ClassNotFoundException
Load a class.

Parameters:
name - The name of the class to load.
resolve - If true then resolve the class.
Returns:
The loaded class.
Throws:
java.lang.ClassNotFoundException - If the class cannot be found.

getURLs

public java.net.URL[] getURLs()
Retrieve the URLs used by this ClassLoader.

Returns:
The urls.

findResource

public java.net.URL findResource(java.lang.String name)