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.exception.DatabaseException;
\r
15 import org.simantics.db.request.ReadInterface;
\r
16 import org.simantics.db.request.WriteInterface;
\r
20 * For initiating requests in synchronous manner. The possible requests are
\r
22 * <li>{@link ReadInterface} for computing a single result
\r
23 * <li>{@link WriteInterface} for making a modification into the database
\r
26 * Some standard implementations of ReadInterface and WriteInterface include
\r
28 * <li>{@link ResourceRead} which is identified by a single resource
\r
29 * <li>{@link ResourceRead2} which is identified by a pair of resources
\r
30 * <li>{@link UnaryRead} which is identifier by a single object
\r
31 * <li>{@link BinaryRead} which is identifier by a pair of objects
\r
32 * <li>{@link UniqueRead} which is unique (not equal to anything but itself)
\r
33 * <li>{@link ReadRequest} which does not report a result
\r
34 * <li>{@link WriteRequest} for writing
\r
37 * The standard RequestProcessors are
\r
39 * <li>{@link ReadGraph} for performing requests during other requests
\r
40 * <li>{@link Session} for initiating a transactions for performing requests
\r
41 * <li>{@link MergingGraphRequestProcessor} for merging several requests in a
\r
42 * single transaction
\r
45 * Database services (see e.g. {@link Session}) are available from implemented
\r
46 * {@link ServiceLocator}. For an asynchronous counterpart with the same
\r
47 * functionality as RequestProcessor see {@link AsyncRequestProcessor}
\r
50 * <b>IMPORTANT:</b>A client invoking any of the <code>sync</code>
\r
51 * -methods in this interface must not assume that the request is performed
\r
52 * within the same thread that performed the <code>syncRequest</code>
\r
53 * invocation. This is an implementation-specific matter.
\r
56 * @author Antti Villberg
\r
57 * @see ReadInterface
\r
58 * @see WriteInterface
\r
61 * @see MergingGraphRequestProcessor
\r
62 * @see AsyncRequestProcessor
\r
64 public interface RequestProcessor extends AsyncRequestProcessor, RequestProcessorSpecific {
\r
66 <T> T sync(ReadInterface<T> r) throws DatabaseException;
\r
67 <T> T sync(WriteInterface<T> r) throws DatabaseException;
\r