UberJarRealmClassLoader
class RealmClassLoader
extends java.net.URLClassLoader
ClassRealm
s.Modifier and Type | Field | Description |
---|---|---|
protected DefaultClassRealm |
realm |
The realm.
|
Constructor | Description |
---|---|
RealmClassLoader(DefaultClassRealm realm) |
Construct.
|
RealmClassLoader(DefaultClassRealm realm,
java.lang.ClassLoader classLoader) |
Construct.
|
Modifier and Type | Method | 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
URL s 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 . |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
protected 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.IOException
java.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.ClassLoader
name
- 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()
URL
s used by this ClassLoader
.getURLs
in class java.net.URLClassLoader
public java.net.URL findResource(java.lang.String name)
findResource
in class java.net.URLClassLoader
public java.net.URL getResource(java.lang.String name)
getResource
in class java.lang.ClassLoader
public 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.URLClassLoader
java.io.IOException
public java.util.Enumeration findResourcesDirect(java.lang.String name) throws java.io.IOException
java.io.IOException