| java.lang.Object org.jboss.mx.loading.LoaderRepository org.jboss.mx.loading.UnifiedLoaderRepository3
All known Subclasses: org.jboss.mx.loading.HeirarchicalLoaderRepository3,
UnifiedLoaderRepository3 | public class UnifiedLoaderRepository3 extends LoaderRepository implements MBeanRegistration,NotificationEmitter,UnifiedLoaderRepository3MBean(Code) | | 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.
author: Scott Stark. author: Adrian Brock. version: $Revision: 57200 $ version: just a hint... xdoclet not really used |
Method Summary | |
public void | addClassLoader(ClassLoader loader) Add a class loader to the repository. | public boolean | addClassLoaderURL(ClassLoader cl, URL url) | public void | addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) addNotificationListener delegates to the broadcaster object we hold. | public void | cacheLoadedClass(String name, Class cls, ClassLoader cl) Add a Class to the repository cache. | public String | displayClassInfo(String className) | public void | flush() | public int | getCacheSize() | public Class | getCachedClass(String classname) | public int | getClassLoadersSize() | public LoaderRepository | getInstance() | public MBeanNotificationInfo[] | getNotificationInfo() | public Set | getPackageClassLoaders(String className) | public URL | getResource(String name, ClassLoader cl) | protected URL | getResourceFromGlobalCache(String name) | protected URL | getResourceFromRepository(String name, ClassLoader cl) | public void | getResources(String name, ClassLoader cl, List urls) Find all resource URLs for the given name. | public URL[] | getURLs() This is a utility method a listing of the URL for all UnifiedClassLoaders
associated with the repository. | public RepositoryClassLoader | getWrappingClassLoader(ClassLoader cl) | public 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. | public 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. | public Class | loadClassBefore(ClassLoader stop, String className) Loads a class from the repository, using the classloaders that were
registered before the given classloader. | public Class | loadClassFromCache(String name) Lookup a Class from the repository cache. | Class | loadClassFromClassLoader(String name, boolean resolve, RepositoryClassLoader cl) | public Class | loadClassWithout(ClassLoader loader, String className) Loads a class from the repository, excluding the given
classloader. | public RepositoryClassLoader | newClassLoader(URL url, boolean addToRepository) | public RepositoryClassLoader | newClassLoader(URL url, URL origURL, boolean addToRepository) | public void | postDeregister() | public void | postRegister(Boolean registrationDone) | public void | preDeregister() | public ObjectName | preRegister(MBeanServer server, ObjectName name) | public LoaderRepository | registerClassLoader(RepositoryClassLoader ucl) This method provides an mbean-accessible way to add a
UnifiedClassloader, and sends a notification when it is added. | public void | removeClassLoader(ClassLoader loader) Remove the class loader from the repository. | public void | removeNotificationListener(NotificationListener listener) | public void | removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) |
addClassLoader | public void addClassLoader(ClassLoader loader)(Code) | | Add a class loader to the repository.
|
cacheLoadedClass | public void cacheLoadedClass(String name, Class cls, ClassLoader cl)(Code) | | Add a Class to the repository cache.
Parameters: name - the fully qualified class name Parameters: cls - the Class instance Parameters: cl - the repository UCL |
displayClassInfo | public String displayClassInfo(String className)(Code) | | A utility method that iterates over all repository class loaders and
display the class information for every UCL that contains the given
className
|
flush | public void flush()(Code) | | |
getCacheSize | public int getCacheSize()(Code) | | |
getClassLoadersSize | public int getClassLoadersSize()(Code) | | |
getPackageClassLoaders | public Set getPackageClassLoaders(String className)(Code) | | Called by LoadMgr to obtain all class loaders for the given className
Set, may be null |
getResource | public URL getResource(String name, ClassLoader cl)(Code) | | Loads a resource following the Unified ClassLoader architecture
|
getResourceFromGlobalCache | protected URL getResourceFromGlobalCache(String name)(Code) | | Check for a resource in the global cache
Synchronizes access to globalResources using the loaderToResourcesMap monitor
Parameters: name - |
getResources | public void getResources(String name, ClassLoader cl, List urls)(Code) | | Find all resource URLs for the given name. This is entails an
exhuastive search of the repository and is an expensive operation.
Parameters: name - the resource name Parameters: cl - the requesting class loader Parameters: urls - a list into which the located resource URLs will be placed |
getURLs | public URL[] getURLs()(Code) | | This is a utility method a listing of the URL for all UnifiedClassLoaders
associated with the repository. It is never called in response to
class or resource loading.
|
getWrappingClassLoader | public RepositoryClassLoader getWrappingClassLoader(ClassLoader cl)(Code) | | Get any wrapping classloader for the passed classloader
Parameters: cl - the wrapped classloader the wrapping classloader or null if not wrapped |
loadClass | public Class loadClass(String name, boolean resolve, ClassLoader cl) throws ClassNotFoundException(Code) | | Unlike other implementations of LoaderRepository, this method does
nothing but ask the UnifiedClassLoader3 to load the class as UCL3s
do not use this method.
|
loadClass | public Class loadClass(String className) throws ClassNotFoundException(Code) | | 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.
Parameters: className - - the class to load |
loadClassBefore | public Class loadClassBefore(ClassLoader stop, String className) throws ClassNotFoundException(Code) | | Loads a class from the repository, using the classloaders that were
registered before the given classloader.
Parameters: stop - consult all the classloaders registered before this onein an attempt to load a class Parameters: className - name of the class to load loaded class instance throws: ClassNotFoundException - if none of the consulted classloaders wereable to load the requested class |
loadClassFromCache | public Class loadClassFromCache(String name)(Code) | | Lookup a Class from the repository cache.
Parameters: name - the fully qualified class name the cached Class if found, null otherwise |
postDeregister | public void postDeregister()(Code) | | |
postRegister | public void postRegister(Boolean registrationDone)(Code) | | |
registerClassLoader | public LoaderRepository registerClassLoader(RepositoryClassLoader ucl)(Code) | | This method provides an mbean-accessible way to add a
UnifiedClassloader, and sends a notification when it is added.
Parameters: ucl - an UnifiedClassLoader value a LoaderRepository value |
removeClassLoader | public void removeClassLoader(ClassLoader loader)(Code) | | Remove the class loader from the repository. This synchronizes on the
this.classLoaders
|
Methods inherited from org.jboss.mx.loading.LoaderRepository | abstract public void addClassLoader(ClassLoader cl)(Code)(Java Doc) abstract public boolean addClassLoaderURL(ClassLoader cl, URL url)(Code)(Java Doc) void cacheLoadedClass(String name, Class cls, ClassLoader cl)(Code)(Java Doc) void clear()(Code)(Java Doc) public int compare(LoaderRepository lr)(Code)(Java Doc) public Class getCachedClass(String classname)(Code)(Java Doc) public Vector getLoaders()(Code)(Java Doc) final public static Class getNativeClassForName(String className)(Code)(Java Doc) abstract public URL getResource(String name, ClassLoader cl)(Code)(Java Doc) abstract public void getResources(String name, ClassLoader cl, List urls)(Code)(Java Doc) public Translator getTranslator()(Code)(Java Doc) public URL[] getURLs()(Code)(Java Doc) abstract public Class loadClass(String className) throws ClassNotFoundException(Code)(Java Doc) abstract public Class loadClass(String name, boolean resolve, ClassLoader cl) throws ClassNotFoundException(Code)(Java Doc) abstract public Class loadClassBefore(ClassLoader stop, String className) throws ClassNotFoundException(Code)(Java Doc) abstract public Class loadClassWithout(ClassLoader loader, String className) throws ClassNotFoundException(Code)(Java Doc) abstract public RepositoryClassLoader newClassLoader(URL url, boolean addToRepository) throws Exception(Code)(Java Doc) abstract public RepositoryClassLoader newClassLoader(URL url, URL origURL, boolean addToRepository) throws Exception(Code)(Java Doc) abstract public void removeClassLoader(ClassLoader cl)(Code)(Java Doc) protected int reverseCompare(LoaderRepository lr)(Code)(Java Doc) public void setTranslator(Translator t)(Code)(Java Doc)
|
|
|