|
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 | |
---|---|
Class<?> |
addClass(byte[] bytes)
Converts an array of bytes into a Class. |
ClassLoader |
getClassLoader()
Returns the underlying classloader this loader is wrapping. |
List<ResourceLoader> |
getParents()
Returns the parent resource loaders. |
URL |
getResource(String name)
Finds the first resource with the given name. |
Iterator<URL> |
getResources(String name)
Find resources with the given name that are available from this ResourceLoader or any of its parents. |
Class<?> |
loadClass(String name)
Loads the class with the specified binary name. |
Method Detail |
---|
List<ResourceLoader> getParents()
Class<?> loadClass(String name) throws ClassNotFoundException
name
- the binary name of the class
ClassNotFoundException
- if the class was not foundClassLoader.loadClass(String)
Class<?> addClass(byte[] bytes)
bytes
- the bytecode for the class; must match the class file format
URL getResource(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 foundIterator<URL> getResources(String name) throws IOException
name
- the resource name
URL
objects for the resource
IOException
- if there was a problem locating the resourcesClassLoader getClassLoader()
|
Tuscany Common | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |