]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.impl/src/org/simantics/db/impl/TransientGraph.java
Yet another fixing commit
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / TransientGraph.java
index 3a552ed194a44877ce20f9e4e5e37fb7668df1f3..adbad4ead40074847330dfab89062514f8d048b0 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.LinkedList;
+import java.util.function.Consumer;
 
 import org.simantics.databoard.Bindings;
 import org.simantics.databoard.binding.Binding;
@@ -48,7 +49,6 @@ import org.simantics.db.procedure.AsyncProcedure;
 import org.simantics.db.request.Write;
 import org.simantics.db.request.WriteOnly;
 import org.simantics.db.service.SerialisationSupport;
-import org.simantics.utils.datastructures.Callback;
 
 import gnu.trove.list.array.TIntArrayList;
 import gnu.trove.map.hash.TIntObjectHashMap;
@@ -423,7 +423,7 @@ public class TransientGraph implements VirtualGraphImpl, VirtualGraphContext {
     final private SerialisationSupport serialization;
     final private ResourceSupport resourceSupport;
     final private VirtualGraphServerSupport virtualGraphServerSupport;
-    final private RequestProcessor sessionRequestProcessor;
+    final private AsyncRequestProcessor sessionRequestProcessor;
     
     /*
      * Cluster array by index.
@@ -446,17 +446,17 @@ public class TransientGraph implements VirtualGraphImpl, VirtualGraphContext {
 
     int[] EMPTY = new int[0];
 
-    public static TransientGraph workspacePersistent(SerialisationSupport ss, VirtualGraphServerSupport vgss, ResourceSupport rs, RequestProcessor srp, String databaseId, String identifier) throws DatabaseException {
+    public static TransientGraph workspacePersistent(SerialisationSupport ss, VirtualGraphServerSupport vgss, ResourceSupport rs, AsyncRequestProcessor srp, String databaseId, String identifier) throws DatabaseException {
         TransientGraph graph = new TransientGraph(ss, vgss, rs, srp, databaseId, identifier, Persistency.WORKSPACE);
         graph.load();
         return graph;
     }
     
-    public static TransientGraph memoryPersistent(SerialisationSupport ss, VirtualGraphServerSupport vgss, ResourceSupport rs, RequestProcessor srp, String databaseId, String identifier) {
+    public static TransientGraph memoryPersistent(SerialisationSupport ss, VirtualGraphServerSupport vgss, ResourceSupport rs, AsyncRequestProcessor srp, String databaseId, String identifier) {
         return new TransientGraph(ss, vgss, rs, srp, databaseId, identifier, Persistency.MEMORY);
     }
     
-    private TransientGraph(SerialisationSupport ss, VirtualGraphServerSupport vgss, ResourceSupport rs, RequestProcessor srp, String databaseId, String identifier, Persistency persistency) {
+    private TransientGraph(SerialisationSupport ss, VirtualGraphServerSupport vgss, ResourceSupport rs, AsyncRequestProcessor srp, String databaseId, String identifier, Persistency persistency) {
         this.serialization = ss;
         this.virtualGraphServerSupport = vgss;
         this.sessionRequestProcessor = srp;
@@ -867,34 +867,34 @@ public class TransientGraph implements VirtualGraphImpl, VirtualGraphContext {
     }
     
     @Override
-    public void load(ReadGraphImpl graph, int resource, int predicate, final Callback<ReadGraphImpl> callback) throws DatabaseException {
+    public void load(ReadGraphImpl graph, int resource, int predicate, final Consumer<ReadGraphImpl> callback) throws DatabaseException {
         producePartialStatements(graph, resource, predicate, new AsyncProcedure<Object>() {
 
             @Override
             public void execute(AsyncReadGraph graph, Object result) {
-                callback.run((ReadGraphImpl)graph);
+                callback.accept((ReadGraphImpl)graph);
             }
 
             @Override
             public void exception(AsyncReadGraph graph, Throwable throwable) {
-                callback.run((ReadGraphImpl)graph);
+                callback.accept((ReadGraphImpl)graph);
             }
             
         });
     }
 
     @Override
-    public void load(ReadGraphImpl graph, int resource, final Callback<ReadGraphImpl> callback) throws DatabaseException {
+    public void load(ReadGraphImpl graph, int resource, final Consumer<ReadGraphImpl> callback) throws DatabaseException {
         produceAllStatements(graph, resource, new AsyncProcedure<Object>() {
 
             @Override
             public void execute(AsyncReadGraph graph, Object result) {
-                callback.run((ReadGraphImpl)graph);
+                callback.accept((ReadGraphImpl)graph);
             }
 
             @Override
             public void exception(AsyncReadGraph graph, Throwable throwable) {
-                callback.run((ReadGraphImpl)graph);
+                callback.accept((ReadGraphImpl)graph);
             }
             
         });