This content has been marked as final.
Show 1 reply
-
1. Re: Module adds invalid delegates
thomas.diesler Sep 14, 2009 4:53 AM (in response to thomas.diesler)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