ResourceClassIterator classes =
classDiscovery.findResourceClasses(classNames[0]);
// If it's set as a property.. it had better be there!
if (classes.hasNext()) {
ResourceClass info = classes.nextResourceClass();
try {
return info.loadClass();
} catch (Exception e) {
// ignore
}
}
} else {
ResourceNameIterator classIter =
(new DiscoverServiceNames(loaders)).findResourceNames(spi.getSPName());
ResourceClassIterator classes =
(new DiscoverClasses(loaders)).findResourceClasses(classIter);
if (!classes.hasNext() && defaultImpl != null) {
return defaultImpl.getDefaultClass(spi, loaders);
}
// Services we iterate through until we find one that loads..
while (classes.hasNext()) {
ResourceClass info = classes.nextResourceClass();
try {
return info.loadClass();
} catch (Exception e) {
// ignore
}
}
}