1 package org.simantics.db.request;
3 import org.simantics.db.AsyncRequestProcessor;
4 import org.simantics.db.ReadGraph;
5 import org.simantics.db.RequestProcessor;
6 import org.simantics.db.Session;
7 import org.simantics.db.exception.DatabaseException;
8 import org.simantics.db.procedure.AsyncListener;
9 import org.simantics.db.procedure.AsyncProcedure;
10 import org.simantics.db.procedure.Listener;
11 import org.simantics.db.procedure.Procedure;
12 import org.simantics.db.procedure.SyncListener;
13 import org.simantics.db.procedure.SyncProcedure;
17 * An interface representing a computation of a single result. Some standard implementations of ReadInterface and WriteInterface include
19 * <li>{@link ResourceRead} which is identified by a single resource
20 * <li>{@link ResourceRead2} which is identified by a pair of resources
21 * <li>{@link UnaryRead} which is identifier by a single object
22 * <li>{@link BinaryRead} which is identifier by a pair of objects
23 * <li>{@link UniqueRead} which is unique (not equal to anything but itself)
24 * <li>{@link ReadRequest} which does not report a result
28 * The client is not expected to implement this class but rather to extend one of the standard implementations.
31 * @author Antti Villberg
33 * @see RequestProcessor
38 public interface ReadInterface<Result> {
40 Result request(RequestProcessor processor) throws DatabaseException;
41 void request(AsyncRequestProcessor processor, AsyncProcedure<Result> procedure);
42 void request(AsyncRequestProcessor processor, Procedure<Result> procedure);
43 void request(AsyncRequestProcessor processor, SyncProcedure<Result> procedure);
44 void request(AsyncRequestProcessor processor, AsyncListener<Result> procedure);
45 void request(AsyncRequestProcessor processor, Listener<Result> procedure);
46 void request(AsyncRequestProcessor processor, SyncListener<Result> procedure);