/** * Remove a dependency. * * @param item the dependency item. */ protected void removeDependsOnMe(RequirementDependencyItem item) { if (context == null) return; DependencyInfo dependencyInfo = context.getDependencyInfo(); dependencyInfo.removeDependsOnMe(item); }
/** * It is lazy shutdown so remove anything that depends upon us for a requirement * We can still handle it after the classloader gets unregistered */ private void enableLazyShutdown() { ControllerContext ctx = getControllerContext(); if (ctx != null) { DependencyInfo info = ctx.getDependencyInfo(); if (info != null) { Set<DependencyItem> items = info.getDependsOnMe(RequirementDependencyItem.class); if (items != null && items.isEmpty() == false) { for (DependencyItem item : items) info.removeDependsOnMe(item); } } } } }
@Override public boolean unresolved(Controller controller) { if (loader != null) { ClassLoaderPolicy policy = getPolicy(); policy.removeExtraDelegate(loader); } Object iDependOn = getIDependOn(); if (iDependOn != null) { ControllerContext context = controller.getContext(iDependOn, null); if (context != null) { DependencyInfo info = context.getDependencyInfo(); info.removeDependsOnMe(this); } } module.removeIDependOn(this); super.unresolved(controller); return false; // return false, so we don't get unwinded }
dependencies.removeDependsOnMe(item); if (info != null) info.removeDependsOnMe(item);