|
Tuscany Common | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResourceLoader
Interface which abstracts the implementation of something that is able to load resources (such as a ClassLoader). All Tuscany code should use this API rather than a ClassLoader directly in order to reduce the risk of memory leaks due to ClassLoader references.
Method Summary | |
---|---|
java.lang.Class<?> |
addClass(byte[] bytes)
Converts an array of bytes into a Class. |
java.lang.ClassLoader |
getClassLoader()
Returns the underlying classloader this loader is wrapping. |
java.util.List<ResourceLoader> |
getParents()
Returns the parent resource loaders. |
java.net.URL |
getResource(java.lang.String name)
Finds the first resource with the given name. |
java.util.Iterator<java.net.URL> |
getResources(java.lang.String name)
Find resources with the given name that are available from this ResourceLoader or any of its parents. |
java.lang.Class<?> |
loadClass(java.lang.String name)
Loads the class with the specified binary name. |
Method Detail |
---|
java.util.List<ResourceLoader> getParents()
java.lang.Class<?> loadClass(java.lang.String name) throws java.lang.ClassNotFoundException
name
- the binary name of the class
java.lang.ClassNotFoundException
- if the class was not foundClassLoader.loadClass(String)
java.lang.Class<?> addClass(byte[] bytes)
bytes
- the bytecode for the class; must match the class file format
java.net.URL getResource(java.lang.String name)
getParents()
)
and the first resource located is found. If no parent returns a resource then
the first resource defined by this ResourceLoader is returned.
name
- the resource name
URL
that can be used to read the resource, or null if no resource could be foundjava.util.Iterator<java.net.URL> getResources(java.lang.String name) throws java.io.IOException
name
- the resource name
URL
objects for the resource
java.io.IOException
- if there was a problem locating the resourcesjava.lang.ClassLoader getClassLoader()
|
Tuscany Common | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |