|
||||||||||
PREV CLASS (src) 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.UnifiedLoaderRepository3 (src)
org.jboss.mx.loading.HeirarchicalLoaderRepository3
A simple extension of UnifiedLoaderRepository3 that adds the notion of a parent UnifiedLoaderRepository. Classes and resources are loaded from child first and then the parent depending on the java2ParentDelegation flag.
Field Summary |
Fields inherited from class org.jboss.mx.loading.LoaderRepository (src) |
instance, loaders, translator |
Constructor Summary | |
HeirarchicalLoaderRepository3(MBeanServer (src) server)
Create a HeirarchicalLoaderRepository3 with a parent obtained by querying the server for the ServerConstants.DEFAULT_LOADER_NAME mbean. |
|
HeirarchicalLoaderRepository3(MBeanServer (src) server,
ObjectName (src) parentName)
Create a HeirarchicalLoaderRepository3 with a parent obtained by querying the server for the parentName mbean. |
|
HeirarchicalLoaderRepository3(UnifiedLoaderRepository3 (src) parent)
Create a HeirarchicalLoaderRepository3 with an explicit parent. |
Method Summary | |
int |
compare(LoaderRepository (src) lr)
Compare two loader repository, by default we do no special ordering |
java.lang.Class |
getCachedClass(java.lang.String classname)
Override getCachedClass to return the parent repository cached class if java2ParentDelegation=true, followed by this repository's cached value. |
java.util.Set |
getPackageClassLoaders(java.lang.String name)
Called by LoadMgr to obtain all class loaders. |
java.net.URL |
getResource(java.lang.String name,
java.lang.ClassLoader scl)
Find a resource from this repository. |
void |
getResources(java.lang.String name,
java.lang.ClassLoader cl,
java.util.List urls)
Find all resource URLs for the given name. |
java.net.URL[] |
getURLs()
Obtain a listing of the URLs for all UnifiedClassLoaders associated with the repository |
boolean |
getUseParentFirst()
Get the use parent first flag. |
java.lang.Class |
loadClass(java.lang.String name,
boolean resolve,
java.lang.ClassLoader scl)
Load a class using the repository class loaders. |
java.lang.Class |
loadClassFromCache(java.lang.String name)
Called by LoadMgr to locate a previously loaded class. |
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 |
protected int |
reverseCompare(LoaderRepository (src) lr)
Allow subclasses to override the ordering |
void |
setUseParentFirst(boolean flag)
Set the use parent first flag. |
Methods inherited from class org.jboss.mx.loading.LoaderRepository (src) |
getLoaders, getNativeClassForName, getTranslator, setTranslator |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.mx.loading.UnifiedLoaderRepositoryMBean (src) |
getTranslator, setTranslator |
Constructor Detail |
public HeirarchicalLoaderRepository3(UnifiedLoaderRepository3 (src) parent) throws AttributeNotFoundException (src) , InstanceNotFoundException (src) , MBeanException (src) , ReflectionException (src)
parent
-
AttributeNotFoundException (src)
InstanceNotFoundException (src)
MBeanException (src)
ReflectionException (src)
public HeirarchicalLoaderRepository3(MBeanServer (src) server) throws AttributeNotFoundException (src) , InstanceNotFoundException (src) , MBeanException (src) , ReflectionException (src)
server
-
AttributeNotFoundException (src)
InstanceNotFoundException (src)
MBeanException (src)
ReflectionException (src)
public HeirarchicalLoaderRepository3(MBeanServer (src) server, ObjectName (src) parentName) throws AttributeNotFoundException (src) , InstanceNotFoundException (src) , MBeanException (src) , ReflectionException (src)
server
- parentName
-
AttributeNotFoundException (src)
InstanceNotFoundException (src)
MBeanException (src)
ReflectionException (src)
Method Detail |
public RepositoryClassLoader (src) newClassLoader(java.net.URL url, boolean addToRepository) throws java.lang.Exception
LoaderRepository (src)
newClassLoader
in interface UnifiedLoaderRepositoryMBean (src)
newClassLoader
in class UnifiedLoaderRepository3 (src)
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 interface UnifiedLoaderRepositoryMBean (src)
newClassLoader
in class UnifiedLoaderRepository3 (src)
java.lang.Exception
public boolean getUseParentFirst()
public void setUseParentFirst(boolean flag)
flag
- true if the parent repository is consulted first, false if the
HeirchicalLoaderRepository is consulted first.public java.lang.Class loadClass(java.lang.String name, boolean resolve, java.lang.ClassLoader scl) throws java.lang.ClassNotFoundException
loadClass
in class UnifiedLoaderRepository3 (src)
name
- The name of the classresolve
- an obsolete unused parameter from ClassLoader.loadClassscl
- The asking class loader
java.lang.ClassNotFoundException
- If the class could not be found.public java.lang.Class getCachedClass(java.lang.String classname)
getCachedClass
in class UnifiedLoaderRepository3 (src)
classname
-
public java.net.URL getResource(java.lang.String name, java.lang.ClassLoader scl)
getResource
in class UnifiedLoaderRepository3 (src)
name
- The name of the resourcescl
- The asking class loader
null
if the
resource could not be found.public void getResources(java.lang.String name, java.lang.ClassLoader cl, java.util.List urls)
getResources
in class UnifiedLoaderRepository3 (src)
name
- the resource namecl
- the requesting class loaderurls
- a list into which the located resource URLs will be placedpublic java.net.URL[] getURLs()
getURLs
in interface UnifiedLoaderRepositoryMBean (src)
getURLs
in class UnifiedLoaderRepository3 (src)
public java.lang.Class loadClassFromCache(java.lang.String name)
loadClassFromCache
in class UnifiedLoaderRepository3 (src)
name
- the fully qualified class name
public java.util.Set getPackageClassLoaders(java.lang.String name)
getPackageClassLoaders
in interface UnifiedLoaderRepository3MBean (src)
getPackageClassLoaders
in class UnifiedLoaderRepository3 (src)
public int compare(LoaderRepository (src) lr)
LoaderRepository (src)
compare
in class LoaderRepository (src)
lr
- the loader repository
protected int reverseCompare(LoaderRepository (src) lr)
LoaderRepository (src)
reverseCompare
in class LoaderRepository (src)
lr
- the loader repository
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |