1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.db;
\r
14 import org.simantics.db.procedure.AsyncListener;
\r
15 import org.simantics.db.procedure.AsyncProcedure;
\r
16 import org.simantics.db.procedure.Listener;
\r
17 import org.simantics.db.procedure.Procedure;
\r
18 import org.simantics.db.procedure.SyncListener;
\r
19 import org.simantics.db.procedure.SyncProcedure;
\r
20 import org.simantics.db.request.AsyncMultiRead;
\r
21 import org.simantics.db.request.AsyncRead;
\r
22 import org.simantics.db.request.MultiRead;
\r
23 import org.simantics.db.request.Read;
\r
24 import org.simantics.db.request.ReadInterface;
\r
25 import org.simantics.db.request.Write;
\r
26 import org.simantics.db.request.WriteInterface;
\r
27 import org.simantics.db.request.WriteOnly;
\r
31 * For initiating requests in asynchronous manner. The possible requests are
\r
33 * <li>{@link Read} for computing a single result synchronously
\r
34 * <li>{@link AsyncRead} for computing a single result asynchronously
\r
35 * <li>{@link MultiRead} for computing a collection of results synchronously
\r
36 * <li>{@link AsyncMultiRead} for computing a collection of results
\r
38 * <li>{@link Write} for reading and writing synchronously
\r
39 * <li>{@link WriteOnly} for writing synchronously
\r
42 * The standard AsyncRequestProcessors are
\r
44 * <li>{@link AsyncReadGraph} for performing requests during other requests
\r
45 * <li>{@link Session} for initiating a transactions for performing requests
\r
46 * <li>{@link MergingGraphRequestProcessor} for merging several requests in a
\r
47 * single transaction
\r
50 * Database services (see e.g. {@link Session}) are available from implemented
\r
51 * {@link ServiceLocator}. For a synchronous counterpart with the same
\r
52 * functionality as AsyncRequestProcessor see {@link RequestProcessor}
\r
55 * @author Antti Villberg
\r
59 * @see AsyncMultiRead
\r
62 * @see AsyncReadGraph
\r
64 * @see MergingGraphRequestProcessor
\r
65 * @see RequestProcessor
\r
67 public interface AsyncRequestProcessor extends ServiceLocator, AsyncRequestProcessorSpecific {
\r
69 Resource getRootLibrary();
\r
72 * @return the {@link Session} for which this processor is based on.
\r
74 Session getSession();
\r
76 <T> void async(ReadInterface<T> r, Procedure<T> procedure);
\r
77 <T> void async(ReadInterface<T> r, AsyncProcedure<T> procedure);
\r
78 <T> void async(ReadInterface<T> r, SyncProcedure<T> procedure);
\r
79 <T> void async(ReadInterface<T> r, Listener<T> procedure);
\r
80 <T> void async(ReadInterface<T> r, AsyncListener<T> procedure);
\r
81 <T> void async(ReadInterface<T> r, SyncListener<T> procedure);
\r
83 <T> void async(WriteInterface<T> r);
\r
84 <T> void async(WriteInterface<T> r, Procedure<T> procedure);
\r
86 Object getModificationCounter();
\r