|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.mx.loading.LoaderRepository
org.jboss.mx.loading.UnifiedLoaderRepository3
org.jboss.mx.loading.HeirarchicalLoaderRepository3
public class 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 |
|---|
instance, loaders, translator |
| Constructor Summary | |
|---|---|
HeirarchicalLoaderRepository3(MBeanServer server)
Create a HeirarchicalLoaderRepository3 with a parent obtained by querying the server for the ServerConstants.DEFAULT_LOADER_NAME mbean. |
|
HeirarchicalLoaderRepository3(MBeanServer server,
ObjectName parentName)
Create a HeirarchicalLoaderRepository3 with a parent obtained by querying the server for the parentName mbean. |
|
HeirarchicalLoaderRepository3(UnifiedLoaderRepository3 parent)
Create a HeirarchicalLoaderRepository3 with an explicit parent. |
|
| Method Summary | |
|---|---|
int |
compare(LoaderRepository lr)
Compare two loader repository, by default we do no special ordering |
Class |
getCachedClass(String classname)
Override getCachedClass to return the parent repository cached class if java2ParentDelegation=true, followed by this repository's cached value. |
Set |
getPackageClassLoaders(String name)
Called by LoadMgr to obtain all class loaders. |
URL |
getResource(String name,
ClassLoader scl)
Find a resource from this repository. |
void |
getResources(String name,
ClassLoader cl,
List urls)
Find all resource URLs for the given name. |
URL[] |
getURLs()
Obtain a listing of the URLs for all UnifiedClassLoaders associated with the repository |
boolean |
getUseParentFirst()
Get the use parent first flag. |
Class |
loadClass(String name,
boolean resolve,
ClassLoader scl)
Load a class using the repository class loaders. |
Class |
loadClassFromCache(String name)
Called by LoadMgr to locate a previously loaded class. |
RepositoryClassLoader |
newClassLoader(URL url,
boolean addToRepository)
Create RepositoryClassLoader and optionally add it to the repository |
RepositoryClassLoader |
newClassLoader(URL url,
URL origURL,
boolean addToRepository)
Create RepositoryClassLoader and optionally add it to the repository |
protected int |
reverseCompare(LoaderRepository 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 |
|---|
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 |
|---|
getTranslator, setTranslator |
| Constructor Detail |
|---|
public HeirarchicalLoaderRepository3(UnifiedLoaderRepository3 parent)
throws AttributeNotFoundException,
InstanceNotFoundException,
MBeanException,
ReflectionException
parent -
AttributeNotFoundException
InstanceNotFoundException
MBeanException
ReflectionException
public HeirarchicalLoaderRepository3(MBeanServer server)
throws AttributeNotFoundException,
InstanceNotFoundException,
MBeanException,
ReflectionException
server -
AttributeNotFoundException
InstanceNotFoundException
MBeanException
ReflectionException
public HeirarchicalLoaderRepository3(MBeanServer server,
ObjectName parentName)
throws AttributeNotFoundException,
InstanceNotFoundException,
MBeanException,
ReflectionException
server - parentName -
AttributeNotFoundException
InstanceNotFoundException
MBeanException
ReflectionException| Method Detail |
|---|
public RepositoryClassLoader newClassLoader(URL url,
boolean addToRepository)
throws Exception
LoaderRepository
newClassLoader in interface UnifiedLoaderRepositoryMBeannewClassLoader in class UnifiedLoaderRepository3url - the URL to use for class loadingaddToRepository - a flag indicating if the CL should be added to
the repository
Exception
public RepositoryClassLoader newClassLoader(URL url,
URL origURL,
boolean addToRepository)
throws Exception
LoaderRepository
newClassLoader in interface UnifiedLoaderRepositoryMBeannewClassLoader in class UnifiedLoaderRepository3url - 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
Exceptionpublic boolean getUseParentFirst()
public void setUseParentFirst(boolean flag)
flag - true if the parent repository is consulted first, false if the
HeirchicalLoaderRepository is consulted first.
public Class loadClass(String name,
boolean resolve,
ClassLoader scl)
throws ClassNotFoundException
loadClass in class UnifiedLoaderRepository3name - The name of the classresolve - an obsolete unused parameter from ClassLoader.loadClassscl - The asking class loader
ClassNotFoundException - If the class could not be found.public Class getCachedClass(String classname)
getCachedClass in class UnifiedLoaderRepository3classname -
public URL getResource(String name,
ClassLoader scl)
getResource in class UnifiedLoaderRepository3name - The name of the resourcescl - The asking class loader
null if the
resource could not be found.
public void getResources(String name,
ClassLoader cl,
List urls)
getResources in class UnifiedLoaderRepository3name - the resource namecl - the requesting class loaderurls - a list into which the located resource URLs will be placedpublic URL[] getURLs()
getURLs in interface UnifiedLoaderRepositoryMBeangetURLs in class UnifiedLoaderRepository3public Class loadClassFromCache(String name)
loadClassFromCache in class UnifiedLoaderRepository3name - the fully qualified class name
public Set getPackageClassLoaders(String name)
getPackageClassLoaders in interface UnifiedLoaderRepository3MBeangetPackageClassLoaders in class UnifiedLoaderRepository3public int compare(LoaderRepository lr)
LoaderRepository
compare in class LoaderRepositorylr - the loader repository
protected int reverseCompare(LoaderRepository lr)
LoaderRepository
reverseCompare in class LoaderRepositorylr - the loader repository
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||