|
Tuscany Common | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tuscany.common.resource.impl.ResourceLoaderImpl
public class ResourceLoaderImpl
Default implementation of the ResourceLoader interface
Constructor Summary | |
---|---|
ResourceLoaderImpl(java.lang.ClassLoader classLoader)
Constructs a new ResourceLoaderImpl to wrap a ClassLoader. |
Method Summary | |
---|---|
java.lang.Class<?> |
addClass(byte[] bytes)
Converts an array of bytes into a Class. |
boolean |
equals(java.lang.Object obj)
|
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. |
int |
hashCode()
|
java.lang.Class<?> |
loadClass(java.lang.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(java.lang.ClassLoader classLoader)
classLoader
- the classloader to wrapMethod Detail |
---|
public java.lang.ClassLoader getClassLoader() throws java.lang.IllegalStateException
ResourceLoader
getClassLoader
in interface ResourceLoader
java.lang.IllegalStateException
public java.util.List<ResourceLoader> getParents()
ResourceLoader
getParents
in interface ResourceLoader
public java.lang.Class<?> loadClass(java.lang.String name) throws java.lang.ClassNotFoundException
ResourceLoader
loadClass
in interface ResourceLoader
name
- the binary name of the class
java.lang.ClassNotFoundException
- if the class was not foundClassLoader.loadClass(String)
public java.lang.Class<?> addClass(byte[] bytes)
ResourceLoader
addClass
in interface ResourceLoader
bytes
- the bytecode for the class; must match the class file format
public java.util.Iterator<java.net.URL> getResources(java.lang.String name) throws java.io.IOException
ResourceLoader
getResources
in interface ResourceLoader
name
- the resource name
URL
objects for the resource
java.io.IOException
- if there was a problem locating the resourcespublic java.net.URL getResource(java.lang.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(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
Tuscany Common | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |