|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.jboss.mx.loading.UnifiedClassLoader
org.jboss.mx.loading.UnifiedClassLoader2
An extension of UnifiedClassLoader that only allows a single thread into its UnifiedLoaderRepository2 by seperating the threads attempting class loading through it and the single thread active in the UnifiedLoaderRepository2 by registering a delegate UnifiedClassLoader with the UnifiedLoaderRepository2 rather than itself. Thus it does not matter how locked up this instance may be by the VM since the calling thread has to acquire a singleton lock to get into the UnifiedLoaderRepository2, and once in, that thread can never interact with any UnifiedClassLoader2, including the instance originating the class loading since only the delegate UnifiedClassLoader instances are registered with the repository.
Field Summary |
Fields inherited from class org.jboss.mx.loading.UnifiedClassLoader |
origURL, repository, unregisterTrace, url |
Constructor Summary | |
UnifiedClassLoader2(URL url)
Construct a UnifiedClassLoader without registering it to the classloader repository. |
|
UnifiedClassLoader2(URL url,
URL origURL)
Construct a UnifiedClassLoader without registering it to the classloader repository. |
|
UnifiedClassLoader2(URL url,
URL origURL,
LoaderRepository repository)
Construct a UnifiedClassLoader and registers it to the given repository. |
Method Summary | |
URL[] |
getClasspath()
This method simply invokes the super.getURLs() method to access the list of URLs that make up the UnifiedClassLoader classpath. |
UnifiedClassLoader |
getDelegate()
|
URL |
getOrigURL()
Get the original URL associated with the UCL. |
URL |
getResource(String name)
Attempts to load the resource from its URL and if not found forwards to the request to LoaderRepository . |
URL |
getURL()
Get the URL associated with the UCL. |
Class |
loadClass(String name,
boolean resolve)
We intercept the load class to know exactly the dependencies of the underlying jar. |
void |
unregister()
|
Methods inherited from class org.jboss.mx.loading.UnifiedClassLoader |
addURL, clearBlacklists, definePackage, equals, findClass, findResources, findResourcesLocally, getAddedOrder, getAllURLs, getLoaderRepository, getObjectName, getPackage, getPackages, getPermissions, getProtectionDomain, getProtectionDomain, getResourceLocally, getURLs, hashCode, loadByteCode, loadClassLocally, setAddedOrder, setRepository, toString |
Methods inherited from class java.net.URLClassLoader |
definePackage, findResource, newInstance, newInstance |
Methods inherited from class java.security.SecureClassLoader |
defineClass |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public UnifiedClassLoader2(URL url)
url
- the single URL to load classes from.public UnifiedClassLoader2(URL url, URL origURL)
url
- the single URL to load classes from.origURL
- the possibly null original URL from which url may
be a local copy or nested jar.public UnifiedClassLoader2(URL url, URL origURL, LoaderRepository repository)
url
- The single URL to load classes from.origURL
- the possibly null original URL from which url may
be a local copy or nested jar.repository
- the repository this classloader delegates to
be a local copy or nested jar.Method Detail |
public void unregister()
unregister
in class UnifiedClassLoader
public UnifiedClassLoader getDelegate()
public URL getURL()
getURL
in class UnifiedClassLoader
public URL getOrigURL()
getOrigURL
in class UnifiedClassLoader
public URL[] getClasspath()
getClasspath
in class UnifiedClassLoader
public Class loadClass(String name, boolean resolve) throws ClassNotFoundException
Forwards request to LoaderRepository
.
loadClass
in class UnifiedClassLoader
ClassNotFoundException
public URL getResource(String name)
LoaderRepository
.
getResource
in class UnifiedClassLoader
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |