X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.db.common%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fcommon%2Fprocedure%2Fsingle%2FSyncReadProcedure.java;h=0aad150ac2b2b3fe83fb8a5f31514d18e733b74f;hb=refs%2Fchanges%2F38%2F238%2F2;hp=4c8b96f109f6963d12c9ff39bc2993e35da91f1f;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/single/SyncReadProcedure.java b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/single/SyncReadProcedure.java index 4c8b96f10..0aad150ac 100644 --- a/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/single/SyncReadProcedure.java +++ b/bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/single/SyncReadProcedure.java @@ -1,34 +1,34 @@ -package org.simantics.db.common.procedure.single; - -import org.simantics.db.AsyncReadGraph; -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.procedure.AsyncProcedure; - -final public class SyncReadProcedure implements AsyncProcedure { - - private Throwable exception = null; - public T result = null; - - @Override - public synchronized void execute(AsyncReadGraph graph, T t) { - result = t; - } - - @Override - public void exception(AsyncReadGraph graph, Throwable t) { - exception = t; - } - - public void checkAndThrow() throws DatabaseException { - if(exception != null) { - if (exception instanceof DatabaseException) - throw (DatabaseException) exception; - else - throw new DatabaseException( - "Unexpected exception in ReadGraph.syncRequest(AsyncRead)", - exception); - } - } - -} - +package org.simantics.db.common.procedure.single; + +import org.simantics.db.AsyncReadGraph; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.procedure.AsyncProcedure; + +final public class SyncReadProcedure implements AsyncProcedure { + + private Throwable exception = null; + public T result = null; + + @Override + public synchronized void execute(AsyncReadGraph graph, T t) { + result = t; + } + + @Override + public void exception(AsyncReadGraph graph, Throwable t) { + exception = t; + } + + public void checkAndThrow() throws DatabaseException { + if(exception != null) { + if (exception instanceof DatabaseException) + throw (DatabaseException) exception; + else + throw new DatabaseException( + "Unexpected exception in ReadGraph.syncRequest(AsyncRead)", + exception); + } + } + +} +