|
|||||||||||
| 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.UnifiedLoaderRepository4
A repository of class loaders that form a flat namespace of classes and resources. This version uses UnifiedClassLoader4 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, nativeClassBySignature, translator |
| Constructor Summary | |
UnifiedLoaderRepository4()
|
|
| 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 |
int |
getCacheSize()
Get the number of classes loaded into the ULR cache. |
HashMap |
getClasses()
The loaded classes cache, HashMap |
int |
getClassIndexSize()
|
UnifiedClassLoader4 |
getClassLoader(String className)
Called by LoadMgr to the class loader for the given className |
HashSet |
getClassLoaders()
HashSet |
LinkedList |
getClassLoaders(String className)
Get the class loaders indexed to the given class name |
int |
getClassLoadersSize()
Get the number of UnifiedClassLoader3s (UCLs) in the ULR |
HashMap |
getClassNamesMap()
|
LoaderRepository |
getInstance()
|
HashMap |
getLoaderToClassesMap()
|
MBeanNotificationInfo[] |
getNotificationInfo()
Returns the notification metadata associated with the MBean. |
URL |
getResource(String name,
ClassLoader cl)
Loads a resource following the Unified ClassLoader architecture |
void |
getResources(String name,
ClassLoader cl,
List 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. |
Class |
loadClass(String className)
Load the given class from the repository. |
Class |
loadClass(String name,
boolean resolve,
ClassLoader cl)
Unlike other implementations of LoaderRepository, this method does nothing but ask the UnifiedClassLoader4 to load the class as UCL4 do not use this method. |
Class |
loadClassFromCache(String name)
Lookup a Class from the repository cache. |
Class |
loadClassFromClassLoader(String name,
boolean resolve,
UnifiedClassLoader cl)
|
Class |
loadClassWithout(ClassLoader loader,
String className)
Not used. |
UnifiedClassLoader |
newClassLoader(URL url,
boolean addToRepository)
Create UnifiedClassLoader and optionally add it to the repository |
UnifiedClassLoader |
newClassLoader(URL url,
URL origURL,
boolean addToRepository)
Create UnifiedClassLoader and optionally add it to the repository |
LoaderRepository |
registerClassLoader(UnifiedClassLoader ucl)
This method provides an mbean-accessible way to add a UnifiedClassloader, and sends a notification when it is added. |
void |
removeClassLoader(ClassLoader cl)
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 |
getCachedClass, getDefaultLoaderRepository, getLoaders, getNativeClassForName, getTranslator, loadClassBefore, 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 UnifiedLoaderRepository4()
| Method Detail |
public UnifiedClassLoader 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 UCL should be added to
the repository
Exceptionpublic UnifiedClassLoader 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 UCL 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 UCL should be added to
the repository
Exceptionpublic HashSet getClassLoaders()
public HashMap getClasses()
public HashMap getClassNamesMap()
public HashMap getLoaderToClassesMap()
public int getCacheSize()
UnifiedLoaderRepository4MBean
getCacheSize in interface UnifiedLoaderRepository4MBeanpublic int getClassLoadersSize()
UnifiedLoaderRepository4MBean
getClassLoadersSize in interface UnifiedLoaderRepository4MBeanpublic int getClassIndexSize()
public void flush()
UnifiedLoaderRepository4MBean
flush in interface UnifiedLoaderRepository4MBeanpublic Class loadClass(String name, boolean resolve, ClassLoader cl) throws ClassNotFoundException
loadClass in class LoaderRepositoryname - resolve - cl -
ClassNotFoundExceptionpublic LinkedList getClassLoaders(String className)
getClassLoaders in interface UnifiedLoaderRepository4MBeanpublic UnifiedClassLoader4 getClassLoader(String className)
UnifiedLoaderRepository4MBean
getClassLoader in interface UnifiedLoaderRepository4MBeanpublic 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 UCLpublic Class loadClassFromClassLoader(String name, boolean resolve, UnifiedClassLoader cl)
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 urls)
getResources in class LoaderRepositoryname - 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 LoaderRepositorypublic String displayClassInfo(String className)
displayClassInfo in interface UnifiedLoaderRepository4MBeanpublic Class loadClass(String className) throws ClassNotFoundException
LoaderRepository
loadClass in interface ClassLoaderRepositoryloadClass in class LoaderRepositoryclassName -
ClassNotFoundExceptionpublic Class loadClassWithout(ClassLoader loader, String className) throws ClassNotFoundException
LoaderRepository
loadClassWithout in interface ClassLoaderRepositoryloadClassWithout in class LoaderRepositoryloader - className -
ClassNotFoundExceptionpublic void addClassLoader(ClassLoader loader)
addClassLoader in class LoaderRepositorypublic boolean addClassLoaderURL(ClassLoader cl, URL url)
LoaderRepository
addClassLoaderURL in class LoaderRepositorycl - url - public void removeClassLoader(ClassLoader cl)
removeClassLoader in interface UnifiedLoaderRepositoryMBeanremoveClassLoader in class LoaderRepositorycl - public LoaderRepository registerClassLoader(UnifiedClassLoader ucl)
registerClassLoader in interface UnifiedLoaderRepositoryMBeanucl - an UnifiedClassLoader value
LoaderRepository valuepublic LoaderRepository getInstance()
getInstance in interface UnifiedLoaderRepositoryMBeanpublic 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()
NotificationBroadcaster
getNotificationInfo in interface NotificationBroadcasterMBeanNotificationInfopublic void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
removeNotificationListener in interface NotificationBroadcasterlistener - a NotificationListener value
ListenerNotFoundException - if an error occurs
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||