|
Tuscany Common | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tuscany.common.resource.impl.ResourceLoaderImpl
public class ResourceLoaderImpl
Default implementation of the ResourceLoader interface
Constructor Summary | |
---|---|
ResourceLoaderImpl(ClassLoader classLoader)
Constructs a new ResourceLoaderImpl to wrap a ClassLoader. |
Method Summary | |
---|---|
Class<?> |
addClass(byte[] bytes)
Converts an array of bytes into a Class. |
boolean |
equals(Object obj)
|
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. |
int |
hashCode()
|
Class<?> |
loadClass(String name)
Loads the class with the specified binary name. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceLoaderImpl(ClassLoader classLoader)
classLoader
- the classloader to wrapMethod Detail |
---|
public ClassLoader getClassLoader() throws IllegalStateException
ResourceLoader
getClassLoader
in interface ResourceLoader
IllegalStateException
public List<ResourceLoader> getParents()
ResourceLoader
getParents
in interface ResourceLoader
public Class<?> loadClass(String name) throws ClassNotFoundException
ResourceLoader
loadClass
in interface ResourceLoader
name
- the binary name of the class
ClassNotFoundException
- if the class was not foundClassLoader.loadClass(String)
public Class<?> addClass(byte[] bytes)
ResourceLoader
addClass
in interface ResourceLoader
bytes
- the bytecode for the class; must match the class file format
public Iterator<URL> getResources(String name) throws IOException
ResourceLoader
getResources
in interface ResourceLoader
name
- the resource name
URL
objects for the resource
IOException
- if there was a problem locating the resourcespublic URL getResource(String name)
ResourceLoader
ResourceLoader.getParents()
)
and the first resource located is found. If no parent returns a resource then
the first resource defined by this ResourceLoader is returned.
getResource
in interface ResourceLoader
name
- the resource name
URL
that can be used to read the resource, or null if no resource could be foundpublic boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
Tuscany Common | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |