]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.impl/src/org/simantics/db/impl/BlockingAsyncProcedure.java
Yet another fixing commit
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / BlockingAsyncProcedure.java
index b751e8f70d5771f8bd0994e58dbaa1d890b53b93..c29e5f9920e26c6166901999d636dfdc28943213 100644 (file)
@@ -22,61 +22,6 @@ import org.simantics.db.impl.graph.ReadGraphImpl;
 import org.simantics.db.procedure.AsyncProcedure;
 
 public class BlockingAsyncProcedure<Result> implements AsyncProcedure<Result> {
-<<<<<<< Upstream, based on branch 'private/antti_threads' of ssh://villberg@gerrit.simantics.org:29418/simantics/platform.git
-
-       final private Object key;
-    final private ReadGraphImpl graph;
-       final private AsyncProcedure<Result> procedure;
-       
-    private Result result = null;
-    private Throwable exception = null;
-    
-    public BlockingAsyncProcedure(ReadGraphImpl graph, AsyncProcedure<Result> procedure, Object key) {
-       this.procedure = procedure;
-       this.key = key;
-       this.graph = ReadGraphImpl.newAsync(graph);
-        this.graph.asyncBarrier.inc();
-    }
-    
-    @Override
-    public void execute(AsyncReadGraph graph, Result result) {
-        this.result = result;
-        this.graph.asyncBarrier.dec();
-        try {
-               if(procedure != null) procedure.execute(graph, result);
-        } catch (Throwable throwable) {
-               Logger.defaultLogError("AsyncProcedure.execute threw for " + procedure, throwable);
-        }
-    }
-
-    @Override
-    public void exception(AsyncReadGraph graph, Throwable t) {
-        this.exception = t;
-        try {
-               if(procedure != null) procedure.exception(graph, t);
-        } catch (Throwable throwable) {
-               Logger.defaultLogError("AsyncProcedure.exception threw for " + procedure, throwable);
-        } finally {
-        }
-        this.graph.asyncBarrier.dec();
-    }
-    
-    public Result get() throws DatabaseException {
-       
-       graph.asyncBarrier.waitBarrier(key, graph);
-       
-       if(exception != null) {
-               if(exception instanceof DatabaseException) throw (DatabaseException)exception;
-               throw new DatabaseException(exception);
-       } else {
-               return result;
-       }
-       
-    }
-    
-    public Result getResult() {
-        return result;
-=======
        
        final private static Object NO_RESULT = new Object();
 
@@ -132,7 +77,6 @@ public class BlockingAsyncProcedure<Result> implements AsyncProcedure<Result> {
     
     public Result getResult() {
         return (Result)result;
->>>>>>> 82fa68e Generate parts of db client query code
     }
     
     public Throwable getException() {