|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.ClassLoader
java.lang.BootClassLoader
class BootClassLoader
Provides an explicit representation of the boot class loader. It sits at the head of the class loader chain and delegates requests to the VM's internal class loading mechanism.
| Field Summary | |
|---|---|
(package private) static BootClassLoader |
instance
|
| Constructor Summary | |
|---|---|
BootClassLoader()
|
|
| Method Summary | |
|---|---|
protected Class<?> |
findClass(String name)
Overridden by subclasses, by default throws ClassNotFoundException. |
protected URL |
findResource(String name)
Returns an URL which can be used to access the resource described by resName, using the class loader's resource lookup algorithm. |
protected Enumeration<URL> |
findResources(String resName)
Returns an Enumeration of URL which can be used to access the resources described by resName, using the class loader's resource lookup algorithm. |
static BootClassLoader |
getInstance()
|
protected Package |
getPackage(String name)
Returns package information for the given package. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static BootClassLoader instance
| Constructor Detail |
|---|
public BootClassLoader()
| Method Detail |
|---|
public static BootClassLoader getInstance()
protected Class<?> findClass(String name)
throws ClassNotFoundException
ClassLoader
findClass in class ClassLoadername - The name of the class to search for.
ClassNotFoundException - if the class cannot be found.protected URL findResource(String name)
ClassLoader
findResource in class ClassLoadername - The name of the resource to find.
protected Enumeration<URL> findResources(String resName)
throws IOException
ClassLoader
findResources in class ClassLoaderresName - The name of the resource to find.
IOException - when an error occursprotected Package getPackage(String name)
myClass.getPackage().getName() happy. Thus we construct a
Package object the first time it is being requested and fill most of the
fields with dummy values. The Package object is then put into the
ClassLoader's Package cache, so we see the same one next time. We don't
create Package objects for null arguments or for the default package.
There a limited chance that we end up with multiple Package objects representing the same package: It can happen when when a package is scattered across different JAR files being loaded by different ClassLoaders. Rather unlikely, and given that this whole thing is more or less a workaround, probably not worth the effort.
getPackage in class ClassLoadername - The name of the package to find
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||