|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.codehaus.classworlds.UberJarRealmClassLoader
public class UberJarRealmClassLoader
Classloader for ClassRealms.
| Field Summary | |
|---|---|
protected DefaultClassRealm |
realm
The realm. |
| Constructor Summary | |
|---|---|
UberJarRealmClassLoader(DefaultClassRealm realm)
|
|
| Method Summary | |
|---|---|
void |
addConstituent(URL constituent)
Add a constituent to this realm for locating classes. |
protected byte[] |
findClassInDirectoryUrl(URL url,
String path)
|
protected byte[] |
findClassInJarStream(URL inUrl,
String path)
|
URL |
findResource(String name)
Find a resource within this ClassLoader only (don't delegate to the parent). |
protected URL |
findResourceInDirectoryUrl(URL inUrl,
String path)
|
protected URL |
findResourceInJarStream(URL inUrl,
String path)
|
Enumeration |
findResources(String name)
|
Enumeration |
findResourcesDirect(String name)
Find resources from this ClassLoader, and don't search the realm. |
byte[] |
getBytesToEndOfStream(DataInputStream in)
Helper method for addConstituent that reads in a DataInputStream and returns it as a byte[] It attempts to use in.available - the size of the file - else defaults to 2048 |
URL |
getResource(String name)
|
URL |
getResourceDirect(String name)
Get a resource from this ClassLoader, and don't search the realm. |
URL[] |
getURLs()
Retrieve the URLs used by this ClassLoader. |
protected Class |
loadClass(String name,
boolean resolve)
Load a class. |
Class |
loadClassDirect(String className)
Load a class directly from this classloader without defering through any other ClassRealm. |
| Methods inherited from class java.net.URLClassLoader |
|---|
addURL, definePackage, findClass, getPermissions, newInstance, newInstance |
| Methods inherited from class java.security.SecureClassLoader |
|---|
defineClass, defineClass |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected DefaultClassRealm realm
| Constructor Detail |
|---|
public UberJarRealmClassLoader(DefaultClassRealm realm)
| Method Detail |
|---|
public void addConstituent(URL constituent)
constituent - URL to contituent jar or directory.
public Class loadClassDirect(String className)
throws ClassNotFoundException
ClassRealm.
className - The name of the class to load.
ClassNotFoundException - If the class could not be found.public URL findResource(String name)
public Enumeration findResourcesDirect(String name)
protected URL findResourceInJarStream(URL inUrl,
String path)
protected URL findResourceInDirectoryUrl(URL inUrl,
String path)
protected byte[] findClassInJarStream(URL inUrl,
String path)
protected byte[] findClassInDirectoryUrl(URL url,
String path)
public byte[] getBytesToEndOfStream(DataInputStream in)
throws IOException
IOException
protected Class loadClass(String name,
boolean resolve)
throws ClassNotFoundException
loadClass in class ClassLoadername - The name of the class to load.resolve - If true then resolve the class.
ClassNotFoundException - If the class cannot be found.public URL[] getURLs()
URLs used by this ClassLoader.
getURLs in class URLClassLoaderpublic URL getResource(String name)
getResource in class ClassLoaderpublic URL getResourceDirect(String name)
public Enumeration findResources(String name)
throws IOException
findResources in class URLClassLoaderIOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||