|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.lang.ClassLoader
|
+--java.security.SecureClassLoader
|
+--net.larsan.urd.util.ResourceClassLoader
A class loader based on a resource locator. This class loader should not be used standalone without a caching resource locator to operate on.
This class only accepts single resources with the same name, so the findResources
method will always return a trivial enumeration.
| Field Summary | |
protected ResourceLocator |
locator
Resource locator used by this class loader. |
| Constructor Summary | |
ResourceClassLoader(java.lang.ClassLoader parent,
ResourceLocator locator)
Create a class loader with a parent loader and a resource locator from which the class loader loads resources and classes. |
|
ResourceClassLoader(ResourceLocator locator)
Create a class loader with a resource locator from which the class loader loads resources and classes. |
|
| Method Summary | |
protected java.lang.Class |
findClass(java.lang.String name)
Find class, this method uses the resource locator to read the class bytes if possible. |
protected java.net.URL |
findResource(java.lang.String name)
Find resource, this method uses the resource locator to resolve the URL and return null in the URL is not found. |
protected java.util.Enumeration |
findResources(java.lang.String name)
Find resources, this method returns a trivial enumeration over the return from the findResource method. |
protected java.security.CodeSource |
getCodeSource(Resource rec)
Get the code source of a resource, this method returns null if no url for the code could be found. |
protected java.security.PermissionCollection |
getPermissions(java.security.CodeSource src)
Get the permission for a code source. |
java.lang.Class |
loadClass(java.lang.String name)
Load a class. |
| Methods inherited from class java.security.SecureClassLoader |
defineClass |
| Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected ResourceLocator locator
| Constructor Detail |
public ResourceClassLoader(java.lang.ClassLoader parent,
ResourceLocator locator)
parent - Parent class loaderlocator - Resoucre locator to resolve resources withpublic ResourceClassLoader(ResourceLocator locator)
locator - Resoucre locator to resolve resources with| Method Detail |
public java.lang.Class loadClass(java.lang.String name)
throws java.lang.ClassNotFoundException
loadClass in class java.lang.ClassLoadername - Class name to load
java.lang.ClassNotFoundException - If the class is not found
protected java.lang.Class findClass(java.lang.String name)
throws java.lang.ClassNotFoundException
findClass in class java.lang.ClassLoadername - Class name to find
java.lang.ClassNotFoundException - If the class is not foundprotected java.security.PermissionCollection getPermissions(java.security.CodeSource src)
getPermissions in class java.security.SecureClassLoadersrc - Code source
protected java.net.URL findResource(java.lang.String name)
findResource in class java.lang.ClassLoadername - Resource name
protected java.util.Enumeration findResources(java.lang.String name)
findResource method.
findResources in class java.lang.ClassLoadername - Resource name
protected java.security.CodeSource getCodeSource(Resource rec)
rec - Resource to create a code source for
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||