]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.testing/src/org/simantics/db/testing/common/ReadCommand.java
Added missing org.simantics.db.{tests,testing} plug-ins.
[simantics/platform.git] / bundles / org.simantics.db.testing / src / org / simantics / db / testing / common / ReadCommand.java
diff --git a/bundles/org.simantics.db.testing/src/org/simantics/db/testing/common/ReadCommand.java b/bundles/org.simantics.db.testing/src/org/simantics/db/testing/common/ReadCommand.java
new file mode 100644 (file)
index 0000000..f25597d
--- /dev/null
@@ -0,0 +1,25 @@
+package org.simantics.db.testing.common;
+
+import org.simantics.db.ReadGraph;
+import org.simantics.db.common.request.ReadRequest;
+import org.simantics.db.exception.DatabaseException;
+
+abstract public class ReadCommand<T extends CommandSequenceEnvironment> extends Command<T> {
+
+       @Override
+       public void run(final T environment) throws Exception {
+               environment.getSession().sync(new ReadRequest() {
+
+                       @Override
+                       public void run(ReadGraph graph) throws DatabaseException {
+                               ReadCommand.this.run(graph, environment);
+                       }
+                       
+               });
+       }
+       
+       protected void run(ReadGraph graph, T environment) throws DatabaseException {
+               
+       }
+
+}