|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jboss.deployment.scope.Scope
Scope is a manager/mediator that connects several ScopedURLClassLoaders with each other and computes their dependencies. The locks used in the scope implementation are quite coarse-grained, maybe thread-unfriendly, but the rationale is that classloading a) happens not too often (hopefully) in the lifecycle of an application b) will dispatch only in special cases (where applications depliberately share classes) to this scope class and c) is optimized by caching the locations.
Field Summary | |
protected java.util.Map |
classLoaders
keeps a map of class loaders that participate in this scope |
protected java.util.Map |
classLocations
keeps a hashtable of class appearances |
protected java.util.Map |
dependencies
keeps a hashtable of dependencies between the classLoaders |
protected Logger |
log
keeps a reference to a logger which which to interact |
protected java.util.Map |
resourceLocations
keeps a hashtable of resource appearances |
Constructor Summary | |
Scope(Logger log)
Creates new Scope |
Method Summary | |
protected boolean |
addDependency(ScopedURLClassLoader source,
ScopedURLClassLoader target)
adds a dependency between two classloaders. |
protected void |
clearByValue(java.util.Map map,
java.lang.Object value)
helper method that will clear all entries from a map with a dedicated target value. |
ScopedURLClassLoader |
deRegisterClassLoader(ScopedURLClassLoader loader)
deRegisters a classloader in this scope removes all cached data related to this classloader |
java.util.Set |
getDependentClassLoaders(ScopedURLClassLoader loader)
returns the classLoaders that a particular classLoader is dependent on. |
java.net.URL |
getResource(java.lang.String name,
ScopedURLClassLoader source)
gets a URL on behalf of a given classloader which may be null in case that we do not check dependencies |
java.lang.Class |
loadClass(java.lang.String className,
boolean resolve,
ScopedURLClassLoader source)
loads a class on behalf of a given classloader |
ScopedURLClassLoader |
registerClassLoader(ScopedURLClassLoader loader)
registers a classloader in this scope |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final java.util.Map classLoaders
protected final java.util.Map dependencies
protected final java.util.Map classLocations
protected final java.util.Map resourceLocations
protected final Logger log
Constructor Detail |
public Scope(Logger log)
Method Detail |
public ScopedURLClassLoader registerClassLoader(ScopedURLClassLoader loader)
public ScopedURLClassLoader deRegisterClassLoader(ScopedURLClassLoader loader)
protected void clearByValue(java.util.Map map, java.lang.Object value)
public java.util.Set getDependentClassLoaders(ScopedURLClassLoader loader)
protected boolean addDependency(ScopedURLClassLoader source, ScopedURLClassLoader target)
public java.lang.Class loadClass(java.lang.String className, boolean resolve, ScopedURLClassLoader source) throws java.lang.ClassNotFoundException
public java.net.URL getResource(java.lang.String name, ScopedURLClassLoader source)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |