|
org.netbeans.bootstrap/1 2.52 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.ClassLoader
org.netbeans.ProxyClassLoader
public class ProxyClassLoader
A class loader that has multiple parents and uses them for loading classes and resources. It is optimized for working in the enviroment of a deeply nested classloader hierarchy. It uses shared knowledge about package population to route the loading request directly to the correct classloader. It doesn't load classes or resources itself, but allows subclasses to add such functionality.
| Constructor Summary | |
|---|---|
ProxyClassLoader(ClassLoader[] parents,
boolean transitive)
Create a multi-parented classloader. |
|
| Method Summary | |
|---|---|
protected void |
addCoveredPackages(Iterable<String> coveredPackages)
|
void |
append(ClassLoader[] nueparents)
Add new parents dynamically. |
protected Package |
definePackage(String name,
String specTitle,
String specVersion,
String specVendor,
String implTitle,
String implVersion,
String implVendor,
URL sealBase)
This is here just for locking serialization purposes. |
void |
destroy()
Called before releasing the classloader so it can itself unregister from the global ClassLoader pool |
protected Class |
doLoadClass(String pkg,
String name)
This ClassLoader can't load anything itself. |
URL |
findResource(String name)
This ClassLoader can't load anything itself. |
Enumeration<URL> |
findResources(String name)
|
protected Package |
getPackage(String name)
Returns a Package that has been defined by this class loader or any of its parents. |
protected Package |
getPackageFast(String name,
boolean recurse)
Faster way to find a package. |
protected Package[] |
getPackages()
Returns all of the Packages defined by this class loader and its parents. |
URL |
getResource(String name)
Finds the resource with the given name. |
Enumeration<URL> |
getResources(String name)
|
protected Class |
loadClass(String name,
boolean resolve)
Loads the class with the specified name. |
protected void |
setSystemClassLoader(ClassLoader s)
|
protected boolean |
shouldDelegateResource(String pkg,
ClassLoader parent)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProxyClassLoader(ClassLoader[] parents,
boolean transitive)
parents - all direct parents of this classloader, except system one.transitive - whether other PCLs depending on this one will
automatically search through its parent list| Method Detail |
|---|
protected final void addCoveredPackages(Iterable<String> coveredPackages)
public void append(ClassLoader[] nueparents)
throws IllegalArgumentException
nueparents - the new parents to add (append to list)
IllegalArgumentException - in case of a null or cyclic parent (duplicate OK)
protected Class loadClass(String name,
boolean resolve)
throws ClassNotFoundException
loadClass in class ClassLoadername - the name of the classresolve - if true then resolve the class
Class object
ClassNotFoundException - if the class could not be found
protected Class doLoadClass(String pkg,
String name)
null if it can't load required class.
name - the name of the class
Class object or nullpublic final URL getResource(String name)
getResource in class ClassLoadername - a "/"-separated path name that identifies the resource.
null if
the resource could not be found.findResource(String)public URL findResource(String name)
findResource in class ClassLoadername - the resource name
null
if the resource could not be found.
public final Enumeration<URL> getResources(String name)
throws IOException
getResources in class ClassLoaderIOException
public Enumeration<URL> findResources(String name)
throws IOException
findResources in class ClassLoaderIOExceptionprotected Package getPackage(String name)
getPackage in class ClassLoadername - the package name
protected Package getPackageFast(String name,
boolean recurse)
name - package name in org.netbeans.modules.foo formatsname - package name in org/netbeans/modules/foo/ formatrecurse - whether to also ask parents
protected Package definePackage(String name,
String specTitle,
String specVersion,
String specVendor,
String implTitle,
String implVersion,
String implVendor,
URL sealBase)
throws IllegalArgumentException
definePackage in class ClassLoaderIllegalArgumentExceptionprotected Package[] getPackages()
getPackages in class ClassLoaderPackage objects defined by this
ClassLoaderprotected final void setSystemClassLoader(ClassLoader s)
protected boolean shouldDelegateResource(String pkg,
ClassLoader parent)
public void destroy()
|
org.netbeans.bootstrap/1 2.52 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||