/** * Search for services. */ // read public <T> ISubscriptionIntermediateFuture<T> searchServices(ClassInfo type, IComponentIdentifier cid, String scope, IAsyncFilter<T> filter) { final SubscriptionIntermediateFuture<T> ret = new SubscriptionIntermediateFuture<T>(); Iterator<T> sers = (Iterator<T>)getServices(type); if(sers!=null && sers.hasNext() && !RequiredServiceInfo.SCOPE_NONE.equals(scope)) { Collection<T> ssers = checkScope(sers, cid, scope, false); checkAsyncFilters(filter, ssers.iterator()).addResultListener(new IntermediateDelegationResultListener<T>(ret)); // filter checks in loop are possibly performed outside of synchornized block // searchLoopServices(filter, sers, cid, scope).addResultListener(new IntermediateDelegationResultListener<T>(ret)); } else { ret.setFinished(); } return ret; }
Collection<T> ssers = searchfunc.checkScope(sers, query.getOwner(), query.getScope(), false);
if(sers!=null && sers.hasNext() && !RequiredServiceInfo.SCOPE_NONE.equals(scope)) Collection<T> ssers = checkScope(sers, cid, scope, false);