|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.loading.LoaderRepository (src)
org.jboss.mx.loading.BasicLoaderRepository
Implements a simple classloader repository for the MBean server. The basic loader repository uses an unordered list of classloaders to try and load the required class. There is no attempt made to resolve conflicts between classes loaded by different classloaders.
A thread's context class loader is always searched first. Context class loader is not required to be registered to the repository.
LoaderRepository
(src) Field Summary |
Fields inherited from class org.jboss.mx.loading.LoaderRepository (src) |
instance, loaders, translator |
Constructor Summary | |
BasicLoaderRepository()
|
Method Summary | |
void |
addClassLoader(java.lang.ClassLoader cl)
Add a class loader to the repository |
boolean |
addClassLoaderURL(java.lang.ClassLoader cl,
java.net.URL url)
Update the set of URLs known to be associated with a previously added class loader. |
java.net.URL |
getResource(java.lang.String name,
java.lang.ClassLoader cl)
Find a resource URL for the given name |
void |
getResources(java.lang.String name,
java.lang.ClassLoader cl,
java.util.List urls)
Find all resource URLs for the given name. |
java.lang.Class |
loadClass(java.lang.String className)
Loads a class from the repository. |
java.lang.Class |
loadClass(java.lang.String name,
boolean resolve,
java.lang.ClassLoader cl)
Load the given class from the repository |
java.lang.Class |
loadClassBefore(java.lang.ClassLoader stop,
java.lang.String className)
Loads a class from the repository, using the classloaders that were registered before the given classloader. |
java.lang.Class |
loadClassWithout(java.lang.ClassLoader skipLoader,
java.lang.String className)
Loads a class from the repository, excluding the given classloader. |
RepositoryClassLoader (src) |
newClassLoader(java.net.URL url,
boolean addToRepository)
Create RepositoryClassLoader and optionally add it to the repository |
RepositoryClassLoader (src) |
newClassLoader(java.net.URL url,
java.net.URL origURL,
boolean addToRepository)
Create RepositoryClassLoader and optionally add it to the repository |
void |
removeClassLoader(java.lang.ClassLoader cl)
Remove a cladd loader from the repository. |
Methods inherited from class org.jboss.mx.loading.LoaderRepository (src) |
compare, getCachedClass, getLoaders, getNativeClassForName, getTranslator, getURLs, reverseCompare, setTranslator |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BasicLoaderRepository()
Method Detail |
public java.lang.Class loadClass(java.lang.String className) throws java.lang.ClassNotFoundException
loadClass
in interface ClassLoaderRepository (src)
loadClass
in class LoaderRepository (src)
className
- the class to load
java.lang.ClassNotFoundException
- when there is no such classpublic java.lang.Class loadClassWithout(java.lang.ClassLoader skipLoader, java.lang.String className) throws java.lang.ClassNotFoundException
loadClassWithout
in interface ClassLoaderRepository (src)
loadClassWithout
in class LoaderRepository (src)
skipLoader
- the classloader to excludeclassName
- the class to load
java.lang.ClassNotFoundException
- when there is no such classpublic java.lang.Class loadClassBefore(java.lang.ClassLoader stop, java.lang.String className) throws java.lang.ClassNotFoundException
loadClassBefore
in interface ClassLoaderRepository (src)
loadClassBefore
in class LoaderRepository (src)
stop
- consult all the classloaders registered before this one
in an attempt to load a classclassName
- name of the class to load
java.lang.ClassNotFoundException
- if none of the consulted classloaders were
able to load the requested classpublic void addClassLoader(java.lang.ClassLoader cl)
LoaderRepository (src)
addClassLoader
in class LoaderRepository (src)
public boolean addClassLoaderURL(java.lang.ClassLoader cl, java.net.URL url)
LoaderRepository (src)
addClassLoaderURL
in class LoaderRepository (src)
cl
- url
- public void removeClassLoader(java.lang.ClassLoader cl)
LoaderRepository (src)
removeClassLoader
in class LoaderRepository (src)
cl
- public RepositoryClassLoader (src) newClassLoader(java.net.URL url, boolean addToRepository) throws java.lang.Exception
LoaderRepository (src)
newClassLoader
in class LoaderRepository (src)
url
- the URL to use for class loadingaddToRepository
- a flag indicating if the CL should be added to
the repository
java.lang.Exception
public RepositoryClassLoader (src) newClassLoader(java.net.URL url, java.net.URL origURL, boolean addToRepository) throws java.lang.Exception
LoaderRepository (src)
newClassLoader
in class LoaderRepository (src)
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
java.lang.Exception
public java.lang.Class loadClass(java.lang.String name, boolean resolve, java.lang.ClassLoader cl) throws java.lang.ClassNotFoundException
LoaderRepository (src)
loadClass
in class LoaderRepository (src)
name
- resolve
- cl
-
java.lang.ClassNotFoundException
public java.net.URL getResource(java.lang.String name, java.lang.ClassLoader cl)
LoaderRepository (src)
getResource
in class LoaderRepository (src)
name
- the resource namecl
- the requesting class loader
public void getResources(java.lang.String name, java.lang.ClassLoader cl, java.util.List urls)
LoaderRepository (src)
getResources
in class LoaderRepository (src)
name
- the resource namecl
- the requesting class loaderurls
- a list into which the located resource URLs will be placed
|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |