[jboss-cvs] JBossAS SVN: r104823 - projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/policy.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sat May 15 05:34:32 EDT 2010
Author: alesj
Date: 2010-05-15 05:34:31 -0400 (Sat, 15 May 2010)
New Revision: 104823
Modified:
projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/policy/WildcardClassLoaderPolicy.java
Log:
Add check if module's CL exists.
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-15 09:14:22 UTC (rev 104822)
+++ projects/jboss-cl/trunk/classloading/src/main/java/org/jboss/classloading/spi/dependency/policy/WildcardClassLoaderPolicy.java 2010-05-15 09:34:31 UTC (rev 104823)
@@ -83,6 +83,18 @@
}
/**
+ * Is the module resolved.
+ *
+ * @param m the module
+ * @return true if resolved, false otherwise
+ */
+ protected boolean isResolved(Module m)
+ {
+ ClassLoader cl = ClassLoading.getClassLoaderForModule(m);
+ return cl != null;
+ }
+
+ /**
* Find module which has a resource parameter.
*
* @param resource the resource
@@ -99,12 +111,15 @@
{
for (Module m : modules)
{
- URL url = m.getResource(resource);
- if (url != null)
+ if (isResolved(m))
{
- resourceCache.put(resource, m);
- used.add(m);
- return m;
+ URL url = m.getResource(resource);
+ if (url != null)
+ {
+ resourceCache.put(resource, m);
+ used.add(m);
+ return m;
+ }
}
}
}
@@ -122,12 +137,15 @@
{
for (Module m : modules)
{
- URL url = m.getResource(path);
- if (url != null)
+ if (isResolved(m))
{
- resourceCache.put(path, m);
- used.add(m);
- return url;
+ URL url = m.getResource(path);
+ if (url != null)
+ {
+ resourceCache.put(path, m);
+ used.add(m);
+ return url;
+ }
}
}
}
@@ -141,16 +159,19 @@
{
for (Module m : modules)
{
- boolean visited = false;
- Enumeration<URL> eu = m.getResources(name);
- while (eu.hasMoreElements())
+ if (isResolved(m))
{
- if (visited == false)
+ boolean visited = false;
+ Enumeration<URL> eu = m.getResources(name);
+ while (eu.hasMoreElements())
{
- used.add(m);
- visited = true;
+ if (visited == false)
+ {
+ used.add(m);
+ visited = true;
+ }
+ urls.add(eu.nextElement());
}
- urls.add(eu.nextElement());
}
}
}
More information about the jboss-cvs-commits
mailing list