ServiceInfo[] infoArray = discovery.findServices(name);
if ( infoArray != null && infoArray.length > 0 ) {
for (int i = 0; i < infoArray.length; i++ ) {
ServiceInfo info = infoArray[i];
try {
Class typeClass = info.getLoader().loadClass( info.getImplName() );
if ( typeClass != null ) {
return newInstance(uri, typeClass);
}
}
catch (Exception e) {
log.error( "Could not load service: " + info.getImplName()
+ " with loader: " + info.getLoader()
);
}
}
}
else {