/** * Check if rid has local part and if it is null. */ protected void checkLocalRid(IResourceIdentifier rid) { if(rid!=null && rid.getLocalIdentifier()!=null && rid.getLocalIdentifier().getUri()==null) { System.out.println("local null rid found: "+rid); // throw new RuntimeException("local rid is null"); } }
public void customResultAvailable(List<IResourceIdentifier> result) { final List<URL> res = new ArrayList<URL>(); for(int i=0; i<result.size(); i++) { res.add(result.get(i).getLocalIdentifier().getUrl()); } res.addAll(getInternalNonManagedURLs()); ret.setResult(res); } });
/** * Test if a rid is local to this platform. */ protected boolean isLocal(IResourceIdentifier rid) { // return rid.getLocalIdentifier()!=null && rid.getLocalIdentifier().getComponentIdentifier().equals(component.getComponentIdentifier().getRoot()); return rid.getLocalIdentifier()!=null && rid.getLocalIdentifier().getHostIdentifier().equals( SUtil.getMacAddress()!=null ? SUtil.getMacAddress() : rootrid.getLocalIdentifier().getComponentIdentifier().getName()); }
/** * Test if equals. */ public boolean equals(Object obj) { boolean ret = false; if(obj instanceof ILocalResourceIdentifier) { ILocalResourceIdentifier other = (ILocalResourceIdentifier)obj; // ret = SUtil.equals(getComponentIdentifier(), other.getComponentIdentifier()) // && SUtil.equals(getUrl(), other.getUrl()); ret = SUtil.equals(getHostIdentifier(), other.getHostIdentifier()) && SUtil.equals(getUri(), other.getUri()); } return ret; }
/** * Test if equals. */ public boolean equals(Object obj) { boolean ret = false; if(obj instanceof ILocalResourceIdentifier) { ILocalResourceIdentifier other = (ILocalResourceIdentifier)obj; // ret = SUtil.equals(getComponentIdentifier(), other.getComponentIdentifier()) // && SUtil.equals(getUrl(), other.getUrl()); ret = SUtil.equals(getHostIdentifier(), other.getHostIdentifier()) && SUtil.equals(getUrl(), other.getUrl()); } return ret; }
ret = lrid.getUri().toString(); ret += " ("+((IResourceIdentifier)o).getLocalIdentifier().getComponentIdentifier()+")";
/** * Test if a rid is local to this platform. */ protected boolean isLocal(IResourceIdentifier rid) { return rid.getLocalIdentifier()!=null && rid.getLocalIdentifier().getComponentIdentifier().equals(component.getComponentIdentifier().getRoot()); } }
/** * Test if a rid is local to this platform. * Test is performed by MAC address. * Root cid is only used as fallback. */ public static boolean isLocal(IResourceIdentifier rid, IComponentIdentifier root) { return rid!=null && rid.getLocalIdentifier()!=null && (SUtil.equals(rid.getLocalIdentifier().getHostIdentifier(), SUtil.getMacAddress()) || SUtil.equals(rid.getLocalIdentifier().getHostIdentifier(), root.getName())); }
assert rid!=null && rid.getLocalIdentifier()!=null && rid.getLocalIdentifier().getComponentIdentifier()!=null; final IComponentIdentifier remote = rid.getLocalIdentifier().getComponentIdentifier(); SServiceProvider.getService(component.getExternalAccess(), IComponentManagementService.class, RequiredServiceInfo.SCOPE_PLATFORM) .addResultListener(new ExceptionDelegationResultListener<IComponentManagementService, Void>(ret)
public void customResultAvailable(List<IResourceIdentifier> result) { final List<URL> res = new ArrayList<URL>(); for(int i=0; i<result.size(); i++) { if(!rootrid.equals(result.get(i))) { res.add(result.get(i).getLocalIdentifier().getUrl()); } } Set<URI> re = getInternalNonManagedURLs(); for(URI uri: re) { URL url = SUtil.toURL0(uri); if(url!=null) res.add(url); } // res.addAll(); // System.out.println("getAllUrls: "+(System.currentTimeMillis()-start)); ret.setResult(res); } });
public void customResultAvailable(List<IResourceIdentifier> result) { final List<URL> res = new ArrayList<URL>(); for(int i=0; i<result.size(); i++) { if(!rootrid.equals(result.get(i))) { URL url = SUtil.toURL0(result.get(i).getLocalIdentifier().getUri()); if(url!=null) res.add(url); } } Set<URI> re = getInternalNonManagedURLs(); for(URI uri: re) { URL url = SUtil.toURL0(uri); if(url!=null) res.add(url); } // res.addAll(); // System.out.println("getAllUrls: "+(System.currentTimeMillis()-start)); ret.setResult(res); } });
/** * Create a new classloader. */ public DelegationURLClassLoader(IResourceIdentifier rid, ClassLoader basecl, DelegationURLClassLoader[] delegates) { super(rid!=null && rid.getLocalIdentifier()!=null? new URL[]{rid.getLocalIdentifier().getUrl()}: new URL[0], // No parent class loader to avoid multiple lookups of unavailable classes (not supported on android) SReflect.isAndroid() ? basecl : null); this.rid = rid; this.basecl = basecl; this.delegates = delegates==null? new ArrayList(): SUtil.arrayToList(delegates); this.parents = new ArrayList<DelegationURLClassLoader>(); // addParentClassLoader(parent); // System.out.println("d1 : "+rid+" "+SUtil.arrayToString(delegates)); }
/** * Create a new classloader. */ public DelegationURLClassLoader(IResourceIdentifier rid, ClassLoader basecl, DelegationURLClassLoader[] delegates) { super(rid!=null && rid.getLocalIdentifier()!=null? new URL[]{rid.getLocalIdentifier().getUrl()}: new URL[0], // No parent class loader to avoid multiple lookups of unavailable classes (not supported on android) SReflect.isAndroid() ? basecl : null); this.rid = rid; this.basecl = basecl; this.delegates = delegates.clone(); // System.out.println("d1 : "+rid+" "+SUtil.arrayToString(delegates)); }
URL url = rid.getLocalIdentifier().getUrl(); File f = new File(url.getFile()); if(url.getFile().endsWith(".jar") && f.exists())
if(pacl==null && ResourceIdentifier.isLocal(parid, component.getComponentIdentifier().getRoot()) && getInternalNonManagedURLs().contains(parid.getLocalIdentifier().getUri()))
ret = lrid.getUrl().toString();
boolean nhasch = n.getChildCount()>0 || (issyscp && ((IResourceIdentifier)n.getMyUserObject()).getLocalIdentifier().getUri().toString().indexOf(".jar")==-1); for(int i=0; i<cnt && !inserted; i++) boolean tmphasch = tmp.getChildCount()>0 || (issyscp && ((IResourceIdentifier)tmp.getMyUserObject()).getLocalIdentifier().getUri().toString().indexOf(".jar")==-1); if((!tmphasch && nhasch) || (tmphasch==nhasch && n.toString().compareTo(tmp.toString())<0 ))
boolean nhasch = n.getChildCount()>0 || (issyscp && ((IResourceIdentifier)n.getMyUserObject()).getLocalIdentifier().getUrl().toString().indexOf(".jar")==-1); for(int i=0; i<cnt && !inserted; i++) boolean tmphasch = tmp.getChildCount()>0 || (issyscp && ((IResourceIdentifier)tmp.getMyUserObject()).getLocalIdentifier().getUrl().toString().indexOf(".jar")==-1); if((!tmphasch && nhasch) || (tmphasch==nhasch && n.toString().compareTo(tmp.toString())<0 ))