public void customResultAvailable(Void result)
{
if(!RequiredServiceInfo.SCOPE_GLOBAL.equals(scope))
{
if(filter==null)
{
Collection<T> sers = SynchronizedServiceRegistry.getRegistry(component).searchServices(type, component.getComponentIdentifier(), scope);
if(proxy)
sers = createRequiredProxies(component, sers, type);
ret.setResult(sers==null? Collections.EMPTY_SET: sers);
}
else
{
IIntermediateResultListener<T> lis = proxy? new IntermediateProxyResultListener<T>(ret, component, type.getType(component.getClassLoader())): new IntermediateDelegationResultListener<T>(ret);
SynchronizedServiceRegistry.getRegistry(component).searchServices(type, component.getComponentIdentifier(), scope, filter)
.addResultListener(new IntermediateComponentResultListener<T>(lis, component));
}
}
else
{
IIntermediateResultListener<T> lis = proxy? new IntermediateProxyResultListener<T>(ret, component, type.getType(component.getClassLoader())): new IntermediateDelegationResultListener<T>(ret);
ISubscriptionIntermediateFuture<T> fut = SynchronizedServiceRegistry.getRegistry(component).searchGlobalServices(type, component.getComponentIdentifier(), filter);
fut.addResultListener(new IntermediateComponentResultListener<T>(lis, component));
}
}
});