|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.loading.LoaderRepository
Abstract base class of all loader repository implementations
BasicLoaderRepository
Field Summary | |
protected static LoaderRepository |
instance
|
protected static Vector |
loaders
|
protected org.jboss.util.loading.Translator |
translator
|
Constructor Summary | |
LoaderRepository()
|
Method Summary | |
abstract void |
addClassLoader(ClassLoader cl)
Add a class loader to the repository |
abstract boolean |
addClassLoaderURL(ClassLoader cl,
URL url)
Update the set of URLs known to be associated with a previously added class loader. |
int |
compare(LoaderRepository lr)
Compare two loader repository, by default we do no special ordering |
Class |
getCachedClass(String classname)
|
Vector |
getLoaders()
|
static Class |
getNativeClassForName(String className)
Return the class of a java native type |
abstract URL |
getResource(String name,
ClassLoader cl)
Find a resource URL for the given name |
abstract void |
getResources(String name,
ClassLoader cl,
List urls)
Find all resource URLs for the given name. |
org.jboss.util.loading.Translator |
getTranslator()
|
URL[] |
getURLs()
|
abstract Class |
loadClass(String className)
Loads a class from the repository. |
abstract Class |
loadClass(String name,
boolean resolve,
ClassLoader cl)
Load the given class from the repository |
abstract Class |
loadClassBefore(ClassLoader stop,
String className)
Loads a class from the repository, using the classloaders that were registered before the given classloader. |
abstract Class |
loadClassWithout(ClassLoader loader,
String className)
Loads a class from the repository, excluding the given classloader. |
abstract RepositoryClassLoader |
newClassLoader(URL url,
boolean addToRepository)
Create RepositoryClassLoader and optionally add it to the repository |
abstract RepositoryClassLoader |
newClassLoader(URL url,
URL origURL,
boolean addToRepository)
Create RepositoryClassLoader and optionally add it to the repository |
abstract void |
removeClassLoader(ClassLoader cl)
Remove a cladd loader from the repository. |
protected int |
reverseCompare(LoaderRepository lr)
Allow subclasses to override the ordering |
void |
setTranslator(org.jboss.util.loading.Translator t)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static Vector loaders
protected static LoaderRepository instance
protected org.jboss.util.loading.Translator translator
Constructor Detail |
public LoaderRepository()
Method Detail |
public Vector getLoaders()
public URL[] getURLs()
public Class getCachedClass(String classname)
public org.jboss.util.loading.Translator getTranslator()
public void setTranslator(org.jboss.util.loading.Translator t)
public int compare(LoaderRepository lr)
lr
- the loader repository
public abstract Class loadClass(String className) throws ClassNotFoundException
loadClass
in interface ClassLoaderRepository
className
- the class to load
ClassNotFoundException
- when there is no such classpublic abstract Class loadClassWithout(ClassLoader loader, String className) throws ClassNotFoundException
loadClassWithout
in interface ClassLoaderRepository
loader
- the classloader to excludeclassName
- the class to load
ClassNotFoundException
- when there is no such classpublic abstract Class loadClassBefore(ClassLoader stop, String className) throws ClassNotFoundException
loadClassBefore
in interface ClassLoaderRepository
stop
- consult all the classloaders registered before this one
in an attempt to load a classclassName
- name of the class to load
ClassNotFoundException
- if none of the consulted classloaders were
able to load the requested classpublic abstract RepositoryClassLoader newClassLoader(URL url, boolean addToRepository) throws Exception
url
- the URL to use for class loadingaddToRepository
- a flag indicating if the CL should be added to
the repository
Exception
public abstract RepositoryClassLoader newClassLoader(URL url, URL origURL, boolean addToRepository) throws Exception
url
- the URL to use for class loadingorigURL
- an orignal URL to use as the URL for the CL CodeSource.
This is useful when the url is a local copy that is difficult to use for
security policy writing.addToRepository
- a flag indicating if the CL should be added to
the repository
Exception
public abstract Class loadClass(String name, boolean resolve, ClassLoader cl) throws ClassNotFoundException
name
- resolve
- cl
-
ClassNotFoundException
public abstract URL getResource(String name, ClassLoader cl)
name
- the resource namecl
- the requesting class loader
public abstract void getResources(String name, ClassLoader cl, List urls)
name
- the resource namecl
- the requesting class loaderurls
- a list into which the located resource URLs will be placedpublic abstract void addClassLoader(ClassLoader cl)
public abstract boolean addClassLoaderURL(ClassLoader cl, URL url)
cl
- url
- public abstract void removeClassLoader(ClassLoader cl)
cl
- public static final Class getNativeClassForName(String className)
protected int reverseCompare(LoaderRepository lr)
lr
- the loader repository
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |