class RealmClassLoader
extends java.net.URLClassLoader
ClassRealms.| Modifier and Type | Field and Description |
|---|---|
protected DefaultClassRealm |
realm
The realm.
|
| Constructor and Description |
|---|
RealmClassLoader(DefaultClassRealm realm)
Construct.
|
RealmClassLoader(DefaultClassRealm realm,
java.lang.ClassLoader classLoader)
Construct.
|
| Modifier and Type | Method and Description |
|---|---|
(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)
Find a resource within this ClassLoader only (don't delegate to the parent).
|
java.util.Enumeration |
findResources(java.lang.String name) |
java.util.Enumeration |
findResourcesDirect(java.lang.String name)
Find resources from this ClassLoader, and don't search the realm.
|
byte[] |
getBytesToEndOfStream(java.io.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
|
(package private) DefaultClassRealm |
getRealm()
Retrieve the realm.
|
java.net.URL |
getResource(java.lang.String name) |
java.net.URL |
getResourceDirect(java.lang.String name)
Get a resource from this ClassLoader, and don't search 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. |
addURL, close, definePackage, findClass, getPermissions, getResourceAsStream, newInstance, newInstanceclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignersprotected DefaultClassRealm realm
RealmClassLoader(DefaultClassRealm realm)
realm - The realm for which this loads.RealmClassLoader(DefaultClassRealm realm, java.lang.ClassLoader classLoader)
realm - The realm for which this loads.classLoader - The parent ClassLoader.DefaultClassRealm getRealm()
void addConstituent(java.net.URL constituent)
constituent - URL to contituent jar or directory.public byte[] getBytesToEndOfStream(java.io.DataInputStream in)
throws java.io.IOException
java.io.IOExceptionjava.lang.Class loadClassDirect(java.lang.String name)
throws java.lang.ClassNotFoundException
ClassRealm.name - The name of the class to load.java.lang.ClassNotFoundException - If the class could not be found.protected java.lang.Class loadClass(java.lang.String name,
boolean resolve)
throws java.lang.ClassNotFoundException
loadClass in class java.lang.ClassLoadername - The name of the class to load.resolve - If true then resolve the class.java.lang.ClassNotFoundException - If the class cannot be found.public java.net.URL[] getURLs()
URLs used by this ClassLoader.getURLs in class java.net.URLClassLoaderpublic java.net.URL findResource(java.lang.String name)
findResource in class java.net.URLClassLoaderpublic java.net.URL getResource(java.lang.String name)
getResource in class java.lang.ClassLoaderpublic java.net.URL getResourceDirect(java.lang.String name)
public java.util.Enumeration findResources(java.lang.String name)
throws java.io.IOException
findResources in class java.net.URLClassLoaderjava.io.IOExceptionpublic java.util.Enumeration findResourcesDirect(java.lang.String name)
throws java.io.IOException
java.io.IOException