log.debug("find: serviceName = '" + fileName + "'");
}
}
final ResourceIterator files =
getDiscover().findResources(fileName);
return new ResourceNameIterator() {
private int idx = 0;
private Vector classNames = null;
private String resource = null;
public boolean hasNext() {
if (resource == null) {
resource = getNextClassName();
}
return resource != null;
}
public String nextResourceName() {
String element = resource;
resource = null;
return element;
}
private String getNextClassName() {
if (classNames == null || idx >= classNames.size()) {
classNames = getNextClassNames();
idx = 0;
if (classNames == null) {
return null;
}
}
String className = (String)classNames.get(idx++);
if (log.isDebugEnabled())
log.debug("getNextClassResource: next class='" + className + "'");
return className;
}
private Vector getNextClassNames() {
while (files.hasNext()) {
Vector results = readServices(files.nextResource());
if (results != null && results.size() > 0) {
return results;
}
}
return null;