classes.add(((TypeResultSelector)selector).getType()); for(int i=0; sec==null && i<classes.size(); i++)
/** * Get all service proxies from a remote component. * (called from arbitrary components) * @param cid The remote provider id. * @param service The service type. * @param scope The search scope. * @return The service proxy. */ public <T> IFuture<T> getServiceProxies(IComponentIdentifier cid, Class<T> service, String scope) { final Future<T> ret = new Future<T>(); getServiceProxies(cid, SServiceProvider.getSearchManager(true, scope), SServiceProvider.getVisitDecider(false, scope), new TypeResultSelector(service, true)) .addResultListener(new ExceptionDelegationResultListener<Object, T>(ret) { public void customResultAvailable(Object result) { ret.setResult((T)result); } }); return ret; }
/** * Get all service proxies from a remote component. * (called from arbitrary components) * @param cid The remote provider id. * @param service The service type. * @param scope The search scope. * @return The service proxy. */ public <T> IFuture<T> getServiceProxies(IComponentIdentifier cid, Class<T> service, String scope) { final Future<T> ret = new Future<T>(); getServiceProxies(cid, SServiceProvider.getSearchManager(true, scope), SServiceProvider.getVisitDecider(false, scope), new TypeResultSelector(service, true)) .addResultListener(new ExceptionDelegationResultListener<Collection<IService>, T>(ret) { public void customResultAvailable(Collection<IService> result) { ret.setResult((T)result); } }); return ret; }
new TypeResultSelector(type, false, RequiredServiceInfo.SCOPE_GLOBAL.equals(scope), filter)); fut.addResultListener(new TerminableIntermediateDelegationResultListener(ret, fut));
classes.add(((TypeResultSelector)selector).getType()); for(int i=0; sec==null && i<classes.size(); i++)
/** * Get a service proxy from a remote component. * (called from arbitrary components) * @param cid The remote provider id. * @param service The service type. * @param scope The search scope. * @return The service proxy. */ public <T> IFuture<T> getServiceProxy(final IComponentIdentifier cid, final Class<T> service, String scope) { final Future<T> ret = new Future<T>(); getServiceProxies(cid, SServiceProvider.getSearchManager(false, scope), SServiceProvider.getVisitDecider(true, scope), new TypeResultSelector(service, true)).addResultListener(new ExceptionDelegationResultListener<Object, T>(ret) { public void customResultAvailable(Object result) { if(result!=null && !((Collection<?>)result).isEmpty()) { Object o = ((Collection<?>)result).iterator().next(); ret.setResult((T)o); } else { super.exceptionOccurred(new ServiceNotFoundException("No proxy for service found: "+cid+", "+service.getName())); } } }); return ret; }
new TypeResultSelector(service, true)).addResultListener(new ExceptionDelegationResultListener<Collection<IService>, T>(ret)
new TypeResultSelector(type, true, RequiredServiceInfo.SCOPE_GLOBAL.equals(scope), filter)) .addResultListener(new IIntermediateResultListener<IService>()