[jboss-cvs] JBossAS SVN: r104818 - in projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency: policy and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri May 14 19:01:04 EDT 2010
Author: alesj
Date: 2010-05-14 19:01:03 -0400 (Fri, 14 May 2010)
New Revision: 104818
Modified:
projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/Module.java
projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/RequirementDependencyItem.java
projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/policy/WildcardClassLoaderPolicy.java
Log:
Minor fixes, add todo for non-cascading module.
Modified: projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/Module.java
===================================================================
--- projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/Module.java 2010-05-14 22:26:19 UTC (rev 104817)
+++ projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/Module.java 2010-05-14 23:01:03 UTC (rev 104818)
@@ -111,7 +111,7 @@
modulesByClassLoader.put(classLoader, module);
- // This is hack - we might not know until the classloader gets constructed whether
+ // This is a hack - we might not know until the classloader gets constructed whether
// it is in a domain that specifies lazy shutdown of the classloader
module.cascadeShutdown = module.isCascadeShutdown();
if (module.cascadeShutdown == false)
Modified: projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/RequirementDependencyItem.java
===================================================================
--- projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/RequirementDependencyItem.java 2010-05-14 22:26:19 UTC (rev 104817)
+++ projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/RequirementDependencyItem.java 2010-05-14 23:01:03 UTC (rev 104818)
@@ -181,7 +181,7 @@
{
resolvedModule.removeDepends(this);
resolvedModule.removeDependsOnMe(this);
- resolvedModule = null;
+ this.resolvedModule = null;
}
super.setResolved(resolved);
}
Modified: projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/policy/WildcardClassLoaderPolicy.java
===================================================================
--- projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/policy/WildcardClassLoaderPolicy.java 2010-05-14 22:26:19 UTC (rev 104817)
+++ projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/policy/WildcardClassLoaderPolicy.java 2010-05-14 23:01:03 UTC (rev 104818)
@@ -189,10 +189,10 @@
resourceCache.clear();
}
- public void addModule(Module module)
+ public void addModule(Module current)
{
- Domain md = getDomain(module);
- if (md != null && module.canResolve(requirement))
+ Domain md = getDomain(current);
+ if (md != null && current.canResolve(requirement))
{
boolean isAncestor = (domain != md); // not the same domain, so it must be ancestor
synchronized (this)
@@ -201,33 +201,33 @@
{
if (domain.isParentFirst())
{
- modules.add(0, module);
+ modules.add(0, current);
parentsBefore++;
}
else
- modules.add(module);
+ modules.add(current);
}
else
- modules.add(parentsBefore, module);
+ modules.add(parentsBefore, current);
}
reset();
}
}
- public void removeModule(Module module)
+ public void removeModule(Module current)
{
- boolean sameModule = this.module == module;
+ boolean sameModule = module == current;
boolean resolvedModule = false;
synchronized (this)
{
- if (modules.remove(module))
+ if (modules.remove(current))
{
if (sameModule == false)
{
resolvedModule = true; // we were part of matching modules, but not our module
- Domain md = getDomain(module);
+ Domain md = getDomain(current);
boolean isAncestor = (domain != md);
if (isAncestor && domain.isParentFirst())
parentsBefore--;
@@ -246,18 +246,25 @@
}
// It's not us (we're already uninstalling) and we used this, let's bounce.
- if (resolvedModule && used.remove(module))
+ if (resolvedModule && used.remove(current))
{
- LifeCycle lifeCycle = this.module.getLifeCycle();
- if (lifeCycle != null && module.isCascadeShutdown() == false)
+ LifeCycle lifeCycle = module.getLifeCycle();
+ if (lifeCycle != null)
{
- try
+ if (current.isCascadeShutdown())
{
- lifeCycle.bounce();
+ try
+ {
+ lifeCycle.bounce(); // let's refresh the wired resources
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Error bouncing module: " + this.module, e);
+ }
}
- catch (Exception e)
+ else
{
- throw new RuntimeException("Error bouncing module: " + this.module, e);
+ // TODO -- make this module somehow available for refresh
}
}
}
More information about the jboss-cvs-commits
mailing list