|
JBossMX Parent POM 6.0.0.GA | |||||||||
| 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
public class UnifiedLoaderRepository3
A repository of class loaders that form a flat namespace of classes and resources. This version uses UnifiedClassLoader3 instances. Class and resource loading is synchronized by the acquiring the monitor to the associated repository structure monitor. See the variable javadoc comments for what monitor is used to access a given structure.
| Field Summary |
|---|
| Fields inherited from class org.jboss.mx.loading.LoaderRepository |
|---|
instance, loaders, translator |
| Constructor Summary | |
|---|---|
UnifiedLoaderRepository3()
|
|
| Method Summary | |
|---|---|
void |
addClassLoader(ClassLoader loader)
Add a class loader to the repository. |
boolean |
addClassLoaderURL(ClassLoader cl,
URL url)
Update the set of URLs known to be associated with a previously added class loader. |
void |
addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
addNotificationListener delegates to the broadcaster object we hold. |
void |
cacheLoadedClass(String name,
Class<?> cls,
ClassLoader cl)
Add a Class to the repository cache. |
String |
displayClassInfo(String className)
A utility method that iterates over all repository class loaders and display the class information for every UCL that contains the given className |
void |
flush()
Flush the ULR classes cache |
Class<?> |
getCachedClass(String classname)
|
int |
getCacheSize()
Get the number of classes loaded into the ULR cache. |
int |
getClassLoadersSize()
Get the number of UnifiedClassLoader3s (UCLs) in the ULR |
LoaderRepository |
getInstance()
|
MBeanNotificationInfo[] |
getNotificationInfo()
|
Set<ClassLoader> |
getPackageClassLoaders(String className)
Called by LoadMgr to obtain all class loaders for the given className |
URL |
getResource(String name,
ClassLoader cl)
Loads a resource following the Unified ClassLoader architecture |
protected URL |
getResourceFromGlobalCache(String name)
Check for a resource in the global cache Synchronizes access to globalResources using the loaderToResourcesMap monitor |
protected URL |
getResourceFromRepository(String name,
ClassLoader cl)
|
void |
getResources(String name,
ClassLoader cl,
List<URL> urls)
Find all resource URLs for the given name. |
URL[] |
getURLs()
This is a utility method a listing of the URL for all UnifiedClassLoaders associated with the repository. |
RepositoryClassLoader |
getWrappingClassLoader(ClassLoader cl)
Get any wrapping classloader for the passed classloader |
Class<?> |
loadClass(String className)
First tries to load from any UCL in the ULR, and if the class is not found, next tries the current thread context class loader. |
Class<?> |
loadClass(String name,
boolean resolve,
ClassLoader cl)
Unlike other implementations of LoaderRepository, this method does nothing but ask the UnifiedClassLoader3 to load the class as UCL3s do not use this method. |
Class<?> |
loadClassBefore(ClassLoader stop,
String className)
Loads a class from the repository, using the classloaders that were registered before the given classloader. |
Class<?> |
loadClassFromCache(String name)
Lookup a Class from the repository cache. |
Class<?> |
loadClassWithout(ClassLoader loader,
String className)
Loads a class from the repository, excluding the given classloader. |
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 |
void |
postDeregister()
|
void |
postRegister(Boolean registrationDone)
|
void |
preDeregister()
|
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
|
LoaderRepository |
registerClassLoader(RepositoryClassLoader ucl)
This method provides an mbean-accessible way to add a UnifiedClassloader, and sends a notification when it is added. |
void |
removeClassLoader(ClassLoader loader)
Remove the class loader from the repository. |
void |
removeNotificationListener(NotificationListener listener)
removeNotificationListener delegates to our broadcaster object |
| Methods inherited from class org.jboss.mx.loading.LoaderRepository |
|---|
compare, getLoaders, getNativeClassForName, getTranslator, reverseCompare, 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 UnifiedLoaderRepository3()
| Method Detail |
|---|
public RepositoryClassLoader newClassLoader(URL url,
boolean addToRepository)
throws Exception
LoaderRepository
newClassLoader in interface UnifiedLoaderRepositoryMBeannewClassLoader in class LoaderRepositoryurl - 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 LoaderRepositoryurl - 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 int getCacheSize()
UnifiedLoaderRepository3MBean
getCacheSize in interface UnifiedLoaderRepository3MBeanpublic int getClassLoadersSize()
UnifiedLoaderRepository3MBean
getClassLoadersSize in interface UnifiedLoaderRepository3MBeanpublic void flush()
UnifiedLoaderRepository3MBean
flush in interface UnifiedLoaderRepository3MBeanpublic Class<?> getCachedClass(String classname)
getCachedClass in class LoaderRepository
public Class<?> loadClass(String name,
boolean resolve,
ClassLoader cl)
throws ClassNotFoundException
loadClass in class LoaderRepositoryClassNotFoundExceptionpublic Set<ClassLoader> getPackageClassLoaders(String className)
getPackageClassLoaders in interface UnifiedLoaderRepository3MBeanpublic Class<?> loadClassFromCache(String name)
name - the fully qualified class name
public void cacheLoadedClass(String name,
Class<?> cls,
ClassLoader cl)
name - the fully qualified class namecls - the Class instancecl - the repository UCL
public URL getResource(String name,
ClassLoader cl)
getResource in class LoaderRepositoryname - the resource namecl - the requesting class loader
public void getResources(String name,
ClassLoader cl,
List<URL> urls)
getResources in class LoaderRepositoryname - the resource namecl - the requesting class loaderurls - a list into which the located resource URLs will be placedprotected URL getResourceFromGlobalCache(String name)
name -
protected URL getResourceFromRepository(String name,
ClassLoader cl)
public URL[] getURLs()
getURLs in interface UnifiedLoaderRepositoryMBeangetURLs in class LoaderRepositorypublic String displayClassInfo(String className)
displayClassInfo in interface UnifiedLoaderRepository3MBean
public Class<?> loadClass(String className)
throws ClassNotFoundException
loadClass in interface ClassLoaderRepositoryloadClass in class LoaderRepositoryclassName - - the class to load
ClassNotFoundException - when there is no such class
public Class<?> loadClassWithout(ClassLoader loader,
String className)
throws ClassNotFoundException
loadClassWithout in interface ClassLoaderRepositoryloadClassWithout in class LoaderRepositoryloader - the classloader to excludeclassName - the class to load
ClassNotFoundException - when there is no such class
public Class<?> loadClassBefore(ClassLoader stop,
String className)
throws ClassNotFoundException
loadClassBefore in interface ClassLoaderRepositoryloadClassBefore in class LoaderRepositorystop - 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 RepositoryClassLoader getWrappingClassLoader(ClassLoader cl)
getWrappingClassLoader in interface UnifiedLoaderRepositoryMBeancl - the wrapped classloader
public void addClassLoader(ClassLoader loader)
addClassLoader in class LoaderRepositoryloader - the classloader
public boolean addClassLoaderURL(ClassLoader cl,
URL url)
LoaderRepository
addClassLoaderURL in class LoaderRepositorypublic void removeClassLoader(ClassLoader loader)
removeClassLoader in interface UnifiedLoaderRepositoryMBeanremoveClassLoader in class LoaderRepositorypublic LoaderRepository registerClassLoader(RepositoryClassLoader ucl)
registerClassLoader in interface UnifiedLoaderRepositoryMBeanucl - an UnifiedClassLoader value
LoaderRepository valuepublic LoaderRepository getInstance()
getInstance in interface UnifiedLoaderRepositoryMBean
public void addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
throws IllegalArgumentException
addNotificationListener in interface NotificationBroadcasterlistener - a NotificationListener valuefilter - a NotificationFilter valuehandback - an Object value
IllegalArgumentException - if an error occurspublic MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo in interface NotificationBroadcaster
public void removeNotificationListener(NotificationListener listener)
throws ListenerNotFoundException
removeNotificationListener in interface NotificationBroadcasterlistener - a NotificationListener value
ListenerNotFoundException - if an error occurs
public ObjectName preRegister(MBeanServer server,
ObjectName name)
throws Exception
preRegister in interface MBeanRegistrationExceptionpublic void postRegister(Boolean registrationDone)
postRegister in interface MBeanRegistration
public void preDeregister()
throws Exception
preDeregister in interface MBeanRegistrationExceptionpublic void postDeregister()
postDeregister in interface MBeanRegistration
|
JBossMX Parent POM 6.0.0.GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||