[jboss-dev-forums] [JBoss Microcontainer Development] - Re: Module adds invalid delegates
thomas.diesler@jboss.com
do-not-reply at jboss.com
Mon Sep 14 04:53:54 EDT 2009
I changed the code such that it adds FilteredDelegateLoaders
| // Only add a the delegate if this is not a self-dependency
| if (iDependOnModule != module)
| {
| // If we are connecting to another module we collect the imported package names per delegate
| if (requirement instanceof PackageRequirement)
| {
| ClassLoaderPolicy policy = delegate.getPolicy();
| List<String> packageNames = delegateToRequiredPackages.get(policy);
| if (packageNames == null)
| {
| packageNames = new ArrayList<String>();
| delegateToRequiredPackages.put(policy, packageNames);
| }
|
| PackageRequirement packageRequirement = (PackageRequirement)requirement;
| packageNames.add(packageRequirement.getName());
| }
| else
| {
| delegates.add(delegate);
| }
| }
|
|
| // Add FilteredDelegateLoaders for all collected package requirements
| for (Entry<ClassLoaderPolicy, List<String>> entry : delegateToRequiredPackages.entrySet())
| {
| PackageClassFilter filter = PackageClassFilter.createPackageClassFilter(entry.getValue());
| delegates.add(new FilteredDelegateLoader(entry.getKey(), filter));
| }
|
For this I needed to change the visibility of DelegateLoader.getPolicy() to public
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4255008#4255008
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4255008
More information about the jboss-dev-forums
mailing list