[JBoss-dev] CVS update: jboss/src/main/org/jboss/deployment/scope Scope.java
User: ejort Date: 02/01/05 04:08:50 Modified:src/main/org/jboss/deployment/scope Scope.java Log: Guarded debug logging Revision ChangesPath 1.7 +6 -5 jboss/src/main/org/jboss/deployment/scope/Scope.java Index: Scope.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/scope/Scope.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Scope.java2001/12/05 22:29:59 1.6 +++ Scope.java2002/01/05 12:08:50 1.7 @@ -26,7 +26,7 @@ * share classes) to this scope class * c) is optimized by caching the locations. * @author cgjung - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ */ public class Scope { @@ -139,10 +139,11 @@ deps=new HashSet(); dependencies.put(target,deps); } - -log.debug("Adding dependency from deployment "+source+":"+source.deployment.getLocalUrl()+" to deployment "+ -target+":"+target.deployment.getLocalUrl()); - + +if (log.isDebugEnabled()) + log.debug("Adding dependency from deployment "+source+":"+source.deployment.getLocalUrl()+" to deployment "+ + target+":"+target.deployment.getLocalUrl()); + return deps.add(source); } else return false; ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/deployment/scope Scope.java
User: boissier Date: 01/12/05 14:29:59 Modified:src/main/org/jboss/deployment/scope Scope.java Log: Added some Javadoc Revision ChangesPath 1.6 +79 -33jboss/src/main/org/jboss/deployment/scope/Scope.java Index: Scope.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/scope/Scope.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Scope.java2001/09/11 18:34:59 1.5 +++ Scope.java2001/12/05 22:29:59 1.6 @@ -7,10 +7,12 @@ package org.jboss.deployment.scope; -import java.util.Set; -import java.util.Map; -import java.util.Iterator; import java.net.URL; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; import org.jboss.logging.Logger; @@ -18,36 +20,46 @@ * 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. + * 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 + * c) is optimized by caching the locations. * @author cgjung - * @version 0.8 + * @version $Revision: 1.6 $ */ public class Scope { /** keeps a map of class loaders that participate in this scope */ -final protected Map classLoaders=new java.util.HashMap(); +final protected Map classLoaders=new HashMap(); /** keeps a hashtable of dependencies between the classLoaders */ -final protected Map dependencies=new java.util.HashMap(); +final protected Map dependencies=new HashMap(); /** keeps a hashtable of class appearances */ -final protected Map classLocations=new java.util.HashMap(); +final protected Map classLocations=new HashMap(); /** keeps a hashtable of resource appearances */ -final protected Map resourceLocations=new java.util.HashMap(); +final protected Map resourceLocations=new HashMap(); /** keeps a reference to a logger which which to interact */ final protected Logger log; -/** Creates new Scope */ +/** + * Creates new Scope + * @param log - The logger this new scope will interact with. + */ public Scope(Logger log) { this.log=log; } -/** registers a classloader in this scope */ +/** + * Registers a classloader in this scope. + * + * @param loader - The classloader to register. + * @return The newly registered classloader. + */ public ScopedURLClassLoader registerClassLoader(ScopedURLClassLoader loader) { // must synchronize not to collide with deregistrations and // dependency logging @@ -55,11 +67,14 @@ return (ScopedURLClassLoader) classLoaders.put(loader.deployment.getLocalUrl(),loader); } } - -/** deRegisters a classloader in this scope - * removes all cached data related to this classloader - */ +/** + * Deregisters a classloader in this scope. + * Removes all cached data related to this classloader. + * + * @param loader - The classloader to deregister. + * @return The newly deregistered classloader. + */ public ScopedURLClassLoader deRegisterClassLoader(ScopedURLClassLoader loader) { // synchronized not to collide with registrations // and dependency logging @@ -75,9 +90,13 @@ } } -/** helper method that will clear all entries from a map - * with a dedicated target value. - */ +/** + * Helper method that will clear all entries from a map + * with a dedicated target value. + * + * @param map - The map we want to clear entries from. + * @param value - The object we want to remove from that map. + */ protected void clearByValue(Map map, Object value) { Iterator values=map.values().iterator(); while(values.hasNext()) { @@ -87,20 +106,29 @@ } } -/** returns the classLoaders that a particular classLoader is - * dependent on. Should be called after locking classLoaders - */ +/**
[JBoss-dev] CVS update: jboss/src/main/org/jboss/deployment/scope Scope.java
User: starksm Date: 01/11/20 01:42:48 Modified:src/main/org/jboss/deployment/scope Tag: Branch_2_4 Scope.java Log: Change to the unified log4j based org.jboss.logging.Logger class. Revision ChangesPath No revision No revision 1.3.4.1 +4 -5 jboss/src/main/org/jboss/deployment/scope/Scope.java Index: Scope.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/scope/Scope.java,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -u -r1.3 -r1.3.4.1 --- Scope.java2001/05/25 09:21:28 1.3 +++ Scope.java2001/11/20 09:42:48 1.3.4.1 @@ -7,13 +7,12 @@ package org.jboss.deployment.scope; -import org.jboss.logging.Log; - +import java.net.URL; import java.util.Set; import java.util.Map; import java.util.Iterator; -import java.net.URL; +import org.jboss.logging.Logger; /** * Scope is a manager/mediator that connects several ScopedURLClassLoaders @@ -41,10 +40,10 @@ final protected Map resourceLocations=new java.util.HashMap(); /** keeps a reference to a logger which which to interact */ -final protected Log log; +final protected Logger log; /** Creates new Scope */ -public Scope(Log log) { +public Scope(Logger log) { this.log=log; } ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/deployment/scope Scope.java ScopedURLClassLoader.java
User: cgjung Date: 01/05/25 02:21:28 Modified:src/main/org/jboss/deployment/scope Scope.java ScopedURLClassLoader.java Log: made parameter order of Scope.loadClass more consistent with ClassLoader.loadClass Revision ChangesPath 1.3 +1 -1 jboss/src/main/org/jboss/deployment/scope/Scope.java Index: Scope.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/scope/Scope.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Scope.java2001/05/23 14:11:59 1.2 +++ Scope.java2001/05/25 09:21:28 1.3 @@ -122,7 +122,7 @@ } /** loads a class on behalf of a given classloader */ -public Class loadClass(String className, ScopedURLClassLoader source, boolean resolve) +public Class loadClass(String className, boolean resolve, ScopedURLClassLoader source) throws ClassNotFoundException { // short look into the class location cache, is synchronized in 1.4 +1 -6 jboss/src/main/org/jboss/deployment/scope/ScopedURLClassLoader.java Index: ScopedURLClassLoader.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/scope/ScopedURLClassLoader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ScopedURLClassLoader.java 2001/05/21 11:32:11 1.3 +++ ScopedURLClassLoader.java 2001/05/25 09:21:28 1.4 @@ -67,26 +67,21 @@ /** redirects loadClass in case that it could not be found locally * @param name name of the class - * * @param resolve whether the class should be resolved - * * @throws ClassNotFoundException if the class could not be found - * * @return the found java class - * */ protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException { try{ return super.loadClass(name,resolve); } catch(ClassNotFoundException e) { // redirect -return scope.loadClass(name,this,resolve); +return scope.loadClass(name,resolve,this); } } /** exposes the proper getResource call * @param name name of the resource - * * @return URL pointing to the resource, null if it could not be found * */ ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/deployment/scope Scope.java
User: cgjung Date: 01/05/23 07:11:59 Modified:src/main/org/jboss/deployment/scope Scope.java Log: added possibility to load classes and resources without affecting dependencies directly through the scope. Revision ChangesPath 1.2 +3 -2 jboss/src/main/org/jboss/deployment/scope/Scope.java Index: Scope.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/scope/Scope.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Scope.java2001/05/18 15:14:19 1.1 +++ Scope.java2001/05/23 14:11:59 1.2 @@ -104,7 +104,7 @@ */ protected boolean addDependency(ScopedURLClassLoader source, ScopedURLClassLoader target) { // no rescursions necessary (but not volatile for the code) -if(!source.equals(target)) { +if(source !=null && target!=null && !source.equals(target)) { Set deps=(Set) dependencies.get(target); @@ -166,7 +166,8 @@ } // sync } -/** gets a URL on behalf of a given classloader */ +/** gets a URL on behalf of a given classloader which may be null + * in case that we do not check dependencies */ public URL getResource(String name, ScopedURLClassLoader source) { // short look into the resource location cache, is synchronized in ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development