import java.util.List;\r
import java.util.Queue;\r
import java.util.Set;\r
-import java.util.Stack;\r
import java.util.concurrent.ConcurrentLinkedQueue;\r
\r
import org.simantics.db.AbstractQuery;\r
public abstract class NodeQuery extends AbstractQuery<Object>{\r
protected Resource nodeResource;\r
private boolean disposed = false;\r
- private IQueryListener listener;\r
- //private OverridingTransactionRunner runner;\r
\r
\r
public NodeQuery(Resource r) {\r
this.nodeResource = r;\r
- //runner = new OverridingTransactionRunner(session,true);\r
- \r
}\r
\r
protected abstract Object compute2(Graph graph);\r
if (disposed)\r
throw new RuntimeException("Updating disposed query"); //return;\r
transactionRunner.run(new GraphRequestAdapter() {\r
- //session.asyncWrite(new GraphRequestAdapter() {\r
@Override\r
public GraphRequestStatus perform(Graph g) throws Exception {\r
if (!disposed) {\r
if (DEBUG) System.out.println("NodeQuery " + nodeResource + " disposed()" + " " + this.getClass());\r
}\r
\r
- //public abstract NodeQuery instantiateQuery(Resource node);\r
- //public abstract void attach();\r
- \r
@Override\r
public boolean isDisposed() {\r
return disposed;\r
}\r
- \r
- @Override\r
- public IQueryListener getListener() {\r
- if (listener == null) {\r
- listener = new IQueryListener() {\r
- @Override\r
- public boolean isDisposed() {\r
- return NodeQuery.this.disposed;\r
- }\r
- \r
- @Override\r
- public void resultChangedRaw(Object oldResult, Object newResult) {\r
- NodeQuery.this.resultChangedRaw(oldResult, newResult);\r
- }\r
- };\r
- }\r
- return listener;\r
- }\r
- \r
}\r
\r
/**\r