import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import java.util.concurrent.Semaphore;
-import java.util.concurrent.TimeUnit;
import org.simantics.db.AsyncReadGraph;
import org.simantics.db.ReadGraph;
-import org.simantics.db.common.GraphSemaphore;
import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;
import org.simantics.db.common.request.AsyncReadRequest;
import org.simantics.db.exception.DatabaseException;
System.out.println(" " + node.getURI(graph));
}*/
-<<<<<<< Upstream, based on branch 'private/antti_threads' of ssh://villberg@gerrit.simantics.org:29418/simantics/platform.git
- GraphSemaphore done = new GraphSemaphore(graph, 0);
-
- for(Variable node : nodes) {
-
- graph.asyncRequest(new NodeRequestE(node), new Listener<JSONObject>() {
-
- @Override
- public void execute(JSONObject result) {
- synchronized(rs) {
- rs.add(result);
- }
- done.release();
- }
-
- @Override
- public void exception(Throwable t) {
- t.printStackTrace();
- done.release();
- }
-
- @Override
- public boolean isDisposed() {
- return true;
- }
-
- });
-
-// rs.add(graph.syncRequest(new NodeRequest(node), TransientCacheAsyncListener.<JSONObject>instance()));
-
- }
-
- try {
- done.waitFor(nodes.size());
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
-=======
graph.syncRequest(new AsyncReadRequest() {
@Override
}
});
->>>>>>> 82fa68e Generate parts of db client query code
ArrayList<JSONObject> result = new ArrayList<JSONObject>(rs);
Collections.sort(result, new Comparator<JSONObject>() {