Adrian Brock wrote:
You want the operation to go through the delegate to the other policy with whatever export/import restrictions apply.
protected DelegateLoader resolve(String pckg)
{
Requirement requirement = new PackageRequirement(pckg, range);
// TODO -- add this DI to module? new DI impl to remove delegate from policy when resolved module goes away?
RequirementDependencyItem item = new RequirementDependencyItem(module, requirement, module.getClassLoaderState(), ControllerState.INSTALLED);
if (item.resolve(controller))
{
ClassLoaderPolicy policy = getPolicy();
// TODO -- add delegate to policy
return delegate;
}
return null;
}
This fixes a lot of your TODOs above. :-.)