final IProgressMonitor monitor) {
final HashSet<Object> z = new HashSet<Object>();
final HashSet<IComplexQueryRequest> req = new HashSet<IComplexQueryRequest>();
try {
orig.execute(facade, new Callback() {
public boolean objectFetched(Object object) {
if (object instanceof State) {
synchronized (req) {
synchronized (z) {
// boolean add = z.add(object);
// if (add) {
cb.objectFetched(object);
// if (z.size() > limit) {
// cancel();
// for (IComplexQueryRequest d : req) {
// d.cancel();
}
}
// }
// }
return true;
// }
}
matching.add(((Entity) object).getKey());
IComplexQueryRequest query = toQuery(object);
synchronized (req) {
req.add(query);
if (req.size() < 10) {
query.execute(facade, new Callback() {
public boolean objectFetched(Object object) {
synchronized (z) {
boolean needToAdd = false;
if (object instanceof State) {