/** * Remove support for a rid. */ protected void removeSupport(IResourceIdentifier rid, IResourceIdentifier parid) { if(rid==null) throw new IllegalArgumentException("Rid must not null."); DelegationURLClassLoader pacl = parid==null || rootrid.equals(parid)? rootloader: (DelegationURLClassLoader)classloaders.get(parid); DelegationURLClassLoader cl = (DelegationURLClassLoader)classloaders.get(rid); pacl.removeDelegateClassLoader(cl); if(cl.removeParentClassLoader(pacl)) { rids = null; notifyRemovalListeners(parid, rid); } // If last support, delete removeSupport to children. if(!cl.hasParentClassLoader()) { DelegationURLClassLoader[] dels = cl.getDelegateClassLoaders(); for(DelegationURLClassLoader del: dels) { removeSupport(del.getResourceIdentifier(), rid); } classloaders.remove(rid); classloaders.remove(ResourceIdentifier.getLocalResourceIdentifier(rid)); } }
/** * Test if the node is removable. */ protected boolean isRemovable() { boolean ret = false; LazyNode pa = (LazyNode)getParent(); if(pa!=null) { Object uo = pa.getMyUserObject(); if(uo==null || uo instanceof IResourceIdentifier) { Object myo = getMyUserObject(); if(myo instanceof IResourceIdentifier) { IResourceIdentifier p = (IResourceIdentifier)uo; IResourceIdentifier ch = (IResourceIdentifier)myo; IResourceIdentifier pl = ResourceIdentifier.getLocalResourceIdentifier(p); ret = remlinks.contains(new Tuple2<IResourceIdentifier, IResourceIdentifier>(p, ch)) || (pl!=null && remlinks.contains(new Tuple2<IResourceIdentifier, IResourceIdentifier>(pl, ch))); } } } return ret; }
IResourceIdentifier localrid = ResourceIdentifier.getLocalResourceIdentifier(rid); if(localrid!=null)
final IResourceIdentifier lrid = ResourceIdentifier.getLocalResourceIdentifier(rid); if(isLocal(rid) && getInternalNonManagedURLs().contains(SUtil.toURI0(rid.getLocalIdentifier().getUrl())))