IService[] services = generateServiceArray(servicemap); getOneResult(fil, services, 0) .addResultListener(new ExceptionDelegationResultListener<IService, Collection<IService>>(ret) getAllResults(fil, services, 0) .addResultListener(new DelegationResultListener<Collection<IService>>(ret));
public void customResultAvailable(Boolean result) { if(result.booleanValue() && !ret.getIntermediateResults().contains(services[i])) { ret.addIntermediateResult(services[i]); } if(i+1<services.length) { getAllResults(filter, services, i+1) .addResultListener(new IntermediateDelegationResultListener<IService>(ret)); } else { ret.setFinished(); } } });
public void customResultAvailable(Boolean result) { if(result.booleanValue()) { ret.setResult(services[i]); } else { if(i+1<services.length) { getOneResult(filter, services, i+1) .addResultListener(new DelegationResultListener<IService>(ret)); } else { ret.setResult(null); } } } });