1 package org.simantics.db.common.procedure.single;
\r
3 import org.simantics.db.AsyncReadGraph;
\r
4 import org.simantics.db.exception.DatabaseException;
\r
5 import org.simantics.db.procedure.AsyncProcedure;
\r
7 final public class SyncReadProcedure<T> implements AsyncProcedure<T> {
\r
9 private Throwable exception = null;
\r
10 public T result = null;
\r
13 public synchronized void execute(AsyncReadGraph graph, T t) {
\r
18 public void exception(AsyncReadGraph graph, Throwable t) {
\r
22 public void checkAndThrow() throws DatabaseException {
\r
23 if(exception != null) {
\r
24 if (exception instanceof DatabaseException)
\r
25 throw (DatabaseException) exception;
\r
27 throw new DatabaseException(
\r
28 "Unexpected exception in ReadGraph.syncRequest(AsyncRead)",
\r