X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.impl%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fimpl%2FBlockingAsyncProcedure.java;fp=bundles%2Forg.simantics.db.impl%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fimpl%2FBlockingAsyncProcedure.java;h=c29e5f9920e26c6166901999d636dfdc28943213;hb=8b6de499c9c1bad0e72631719fd165ce39d6ad56;hp=b751e8f70d5771f8bd0994e58dbaa1d890b53b93;hpb=25b0e1909c94977871479b469da722ed38e980c0;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/BlockingAsyncProcedure.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/BlockingAsyncProcedure.java index b751e8f70..c29e5f992 100644 --- a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/BlockingAsyncProcedure.java +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/BlockingAsyncProcedure.java @@ -22,61 +22,6 @@ import org.simantics.db.impl.graph.ReadGraphImpl; import org.simantics.db.procedure.AsyncProcedure; public class BlockingAsyncProcedure implements AsyncProcedure { -<<<<<<< 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 procedure; - - private Result result = null; - private Throwable exception = null; - - public BlockingAsyncProcedure(ReadGraphImpl graph, AsyncProcedure 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 implements AsyncProcedure { public Result getResult() { return (Result)result; ->>>>>>> 82fa68e Generate parts of db client query code } public Throwable getException() {