|
||||||||||
PREV CLASS (src) NEXT CLASS | 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
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 (src) |
instance, loaders, translator |
Constructor Summary | |
UnifiedLoaderRepository3()
|
Method Summary | |
void |
addClassLoader(java.lang.ClassLoader loader)
Add a class loader to the repository. |
boolean |
addClassLoaderURL(java.lang.ClassLoader cl,
java.net.URL url)
Update the set of URLs known to be associated with a previously added class loader. |
void |
addNotificationListener(NotificationListener (src) listener,
NotificationFilter (src) filter,
java.lang.Object handback)
addNotificationListener delegates to the broadcaster object we hold. |
void |
cacheLoadedClass(java.lang.String name,
java.lang.Class cls,
java.lang.ClassLoader cl)
Add a Class to the repository cache. |
java.lang.String |
displayClassInfo(java.lang.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 |
java.lang.Class |
getCachedClass(java.lang.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 (src) |
getInstance()
|
MBeanNotificationInfo (src) [] |
getNotificationInfo()
Returns the notification metadata associated with the MBean. |
java.util.Set |
getPackageClassLoaders(java.lang.String className)
Called by LoadMgr to obtain all class loaders for the given className |
java.net.URL |
getResource(java.lang.String name,
java.lang.ClassLoader cl)
Loads a resource following the Unified ClassLoader architecture |
protected java.net.URL |
getResourceFromGlobalCache(java.lang.String name)
Check for a resource in the global cache Synchronizes access to globalResources using the loaderToResourcesMap monitor |
protected java.net.URL |
getResourceFromRepository(java.lang.String name,
java.lang.ClassLoader cl)
|
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()
This is a utility method a listing of the URL for all UnifiedClassLoaders associated with the repository. |
RepositoryClassLoader (src) |
getWrappingClassLoader(java.lang.ClassLoader cl)
Get any wrapping classloader for the passed classloader |
java.lang.Class |
loadClass(java.lang.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. |
java.lang.Class |
loadClass(java.lang.String name,
boolean resolve,
java.lang.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. |
java.lang.Class |
loadClassBefore(java.lang.ClassLoader stop,
java.lang.String className)
Loads a class from the repository, using the classloaders that were registered before the given classloader. |
java.lang.Class |
loadClassFromCache(java.lang.String name)
Lookup a Class from the repository cache. |
java.lang.Class |
loadClassWithout(java.lang.ClassLoader loader,
java.lang.String className)
Loads a class from the repository, excluding the given classloader. |
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 |
void |
postDeregister()
This method is called by the MBeanServer after deregistration takes place. |
void |
postRegister(java.lang.Boolean registrationDone)
This method is called by the MBeanServer after registration takes place or when registration fails. |
void |
preDeregister()
This method is called by the MBeanServer before deregistration takes place. |
ObjectName (src) |
preRegister(MBeanServer (src) server,
ObjectName (src) name)
This method is called by the MBeanServer before registration takes place. |
LoaderRepository (src) |
registerClassLoader(RepositoryClassLoader (src) ucl)
This method provides an mbean-accessible way to add a UnifiedClassloader, and sends a notification when it is added. |
void |
removeClassLoader(java.lang.ClassLoader loader)
Remove the class loader from the repository. |
void |
removeNotificationListener(NotificationListener (src) listener)
removeNotificationListener delegates to our broadcaster object |
void |
removeNotificationListener(NotificationListener (src) listener,
NotificationFilter (src) filter,
java.lang.Object handback)
Removes a listener from the Emitter. |
Methods inherited from class org.jboss.mx.loading.LoaderRepository (src) |
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 (src) |
getTranslator, setTranslator |
Constructor Detail |
public UnifiedLoaderRepository3()
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 LoaderRepository (src)
url
- the URL to use for class loadingaddToRepository
- a flag indicating if the CL should be added to
the repository
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 LoaderRepository (src)
url
- 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
java.lang.Exception
public int getCacheSize()
UnifiedLoaderRepository3MBean (src)
getCacheSize
in interface UnifiedLoaderRepository3MBean (src)
public int getClassLoadersSize()
UnifiedLoaderRepository3MBean (src)
getClassLoadersSize
in interface UnifiedLoaderRepository3MBean (src)
public void flush()
UnifiedLoaderRepository3MBean (src)
flush
in interface UnifiedLoaderRepository3MBean (src)
public java.lang.Class getCachedClass(java.lang.String classname)
getCachedClass
in class LoaderRepository (src)
public java.lang.Class loadClass(java.lang.String name, boolean resolve, java.lang.ClassLoader cl) throws java.lang.ClassNotFoundException
loadClass
in class LoaderRepository (src)
name
- resolve
- cl
-
java.lang.ClassNotFoundException
public java.util.Set getPackageClassLoaders(java.lang.String className)
getPackageClassLoaders
in interface UnifiedLoaderRepository3MBean (src)
public java.lang.Class loadClassFromCache(java.lang.String name)
name
- the fully qualified class name
public void cacheLoadedClass(java.lang.String name, java.lang.Class cls, java.lang.ClassLoader cl)
name
- the fully qualified class namecls
- the Class instancecl
- the repository UCLpublic java.net.URL getResource(java.lang.String name, java.lang.ClassLoader cl)
getResource
in class LoaderRepository (src)
name
- the resource namecl
- the requesting class loader
public void getResources(java.lang.String name, java.lang.ClassLoader cl, java.util.List urls)
getResources
in class LoaderRepository (src)
name
- the resource namecl
- the requesting class loaderurls
- a list into which the located resource URLs will be placedprotected java.net.URL getResourceFromGlobalCache(java.lang.String name)
name
-
protected java.net.URL getResourceFromRepository(java.lang.String name, java.lang.ClassLoader cl)
public java.net.URL[] getURLs()
getURLs
in interface UnifiedLoaderRepositoryMBean (src)
getURLs
in class LoaderRepository (src)
public java.lang.String displayClassInfo(java.lang.String className)
displayClassInfo
in interface UnifiedLoaderRepository3MBean (src)
public java.lang.Class loadClass(java.lang.String className) throws java.lang.ClassNotFoundException
loadClass
in interface ClassLoaderRepository (src)
loadClass
in class LoaderRepository (src)
className
- - the class to load
java.lang.ClassNotFoundException
- when there is no such classpublic java.lang.Class loadClassWithout(java.lang.ClassLoader loader, java.lang.String className) throws java.lang.ClassNotFoundException
loadClassWithout
in interface ClassLoaderRepository (src)
loadClassWithout
in class LoaderRepository (src)
loader
- the classloader to excludeclassName
- the class to load
java.lang.ClassNotFoundException
- when there is no such classpublic java.lang.Class loadClassBefore(java.lang.ClassLoader stop, java.lang.String className) throws java.lang.ClassNotFoundException
loadClassBefore
in interface ClassLoaderRepository (src)
loadClassBefore
in class LoaderRepository (src)
stop
- consult all the classloaders registered before this one
in an attempt to load a classclassName
- name of the class to load
java.lang.ClassNotFoundException
- if none of the consulted classloaders were
able to load the requested classpublic RepositoryClassLoader (src) getWrappingClassLoader(java.lang.ClassLoader cl)
getWrappingClassLoader
in interface UnifiedLoaderRepositoryMBean (src)
cl
- the wrapped classloader
public void addClassLoader(java.lang.ClassLoader loader)
addClassLoader
in class LoaderRepository (src)
public boolean addClassLoaderURL(java.lang.ClassLoader cl, java.net.URL url)
LoaderRepository (src)
addClassLoaderURL
in class LoaderRepository (src)
cl
- url
- public void removeClassLoader(java.lang.ClassLoader loader)
removeClassLoader
in interface UnifiedLoaderRepositoryMBean (src)
removeClassLoader
in class LoaderRepository (src)
loader
- public LoaderRepository (src) registerClassLoader(RepositoryClassLoader (src) ucl)
registerClassLoader
in interface UnifiedLoaderRepositoryMBean (src)
ucl
- an UnifiedClassLoader
value
LoaderRepository
valuepublic LoaderRepository (src) getInstance()
getInstance
in interface UnifiedLoaderRepositoryMBean (src)
public void addNotificationListener(NotificationListener (src) listener, NotificationFilter (src) filter, java.lang.Object handback) throws java.lang.IllegalArgumentException
addNotificationListener
in interface NotificationBroadcaster (src)
listener
- a NotificationListener
valuefilter
- a NotificationFilter
valuehandback
- an Object
value
java.lang.IllegalArgumentException
- if an error occurspublic MBeanNotificationInfo (src) [] getNotificationInfo()
NotificationBroadcaster (src)
getNotificationInfo
in interface NotificationBroadcaster (src)
MBeanNotificationInfo
(src) public void removeNotificationListener(NotificationListener (src) listener) throws ListenerNotFoundException (src)
removeNotificationListener
in interface NotificationBroadcaster (src)
listener
- a NotificationListener
value
ListenerNotFoundException (src)
- if an error occurspublic void removeNotificationListener(NotificationListener (src) listener, NotificationFilter (src) filter, java.lang.Object handback) throws ListenerNotFoundException (src)
NotificationEmitter (src)
Only the listener, filter, handback triplet is removed
removeNotificationListener
in interface NotificationEmitter (src)
listener
- the listener object to removefilter
- the filter registered with the listenerhandback
- the handback object associated with the registered listener
ListenerNotFoundException (src)
- if the listener was not foundpublic ObjectName (src) preRegister(MBeanServer (src) server, ObjectName (src) name) throws java.lang.Exception
MBeanRegistration (src)
The MBean can stop the registration by throwing an exception.The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.
preRegister
in interface MBeanRegistration (src)
java.lang.Exception
- for any error, the MBean is not registered.public void postRegister(java.lang.Boolean registrationDone)
MBeanRegistration (src)
postRegister
in interface MBeanRegistration (src)
registrationDone
- the MBeanServer passes true when the
MBean was registered, false otherwise.public void preDeregister() throws java.lang.Exception
MBeanRegistration (src)
The MBean can throw an exception, this will stop the deregistration. The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.
preDeregister
in interface MBeanRegistration (src)
java.lang.Exception
public void postDeregister()
MBeanRegistration (src)
postDeregister
in interface MBeanRegistration (src)
|
||||||||||
PREV CLASS (src) NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |