]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db/src/org/simantics/db/RequestProcessor.java
Fail safe import fixes made by Antti
[simantics/platform.git] / bundles / org.simantics.db / src / org / simantics / db / RequestProcessor.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.db;
13
14 import org.simantics.db.exception.DatabaseException;
15 import org.simantics.db.request.ReadInterface;
16 import org.simantics.db.request.WriteInterface;
17
18 /**
19  * 
20  * For initiating requests in synchronous manner. The possible requests are
21  * <ul>
22  * <li>{@link ReadInterface} for computing a single result
23  * <li>{@link WriteInterface} for making a modification into the database
24  * </ul>
25  * <p>
26  * Some standard implementations of ReadInterface and WriteInterface include
27  * <ul>
28  * <li>{@link ResourceRead} which is identified by a single resource
29  * <li>{@link ResourceRead2} which is identified by a pair of resources
30  * <li>{@link UnaryRead} which is identifier by a single object
31  * <li>{@link BinaryRead} which is identifier by a pair of objects
32  * <li>{@link UniqueRead} which is unique (not equal to anything but itself)
33  * <li>{@link ReadRequest} which does not report a result
34  * <li>{@link WriteRequest} for writing
35  * </ul>
36  * <p>
37  * The standard RequestProcessors are
38  * <ul>
39  * <li>{@link ReadGraph} for performing requests during other requests
40  * <li>{@link Session} for initiating a transactions for performing requests
41  * <li>{@link MergingGraphRequestProcessor} for merging several requests in a
42  * single transaction
43  * </ul>
44  * 
45  * Database services (see e.g. {@link Session}) are available from implemented
46  * {@link ServiceLocator}. For an asynchronous counterpart with the same
47  * functionality as RequestProcessor see {@link AsyncRequestProcessor}
48  * 
49  * <p>
50  * <b>IMPORTANT:</b>A client invoking any of the <code>sync</code>
51  * -methods in this interface must not assume that the request is performed
52  * within the same thread that performed the <code>syncRequest</code>
53  * invocation. This is an implementation-specific matter.
54  * 
55  * @version 1.5
56  * @author Antti Villberg
57  * @see ReadInterface
58  * @see WriteInterface
59  * @see ReadGraph
60  * @see Session
61  * @see MergingGraphRequestProcessor
62  * @see AsyncRequestProcessor
63  */
64 public interface RequestProcessor extends AsyncRequestProcessor, RequestProcessorSpecific {
65
66     <T> T sync(ReadInterface<T> r) throws DatabaseException;
67     <T> T sync(WriteInterface<T> r) throws DatabaseException;
68     
69 }