1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
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
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.db;
14 import org.simantics.db.exception.DatabaseException;
15 import org.simantics.db.request.ReadInterface;
16 import org.simantics.db.request.WriteInterface;
20 * For initiating requests in synchronous manner. The possible requests are
22 * <li>{@link ReadInterface} for computing a single result
23 * <li>{@link WriteInterface} for making a modification into the database
26 * Some standard implementations of ReadInterface and WriteInterface include
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
37 * The standard RequestProcessors are
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
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}
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.
56 * @author Antti Villberg
61 * @see MergingGraphRequestProcessor
62 * @see AsyncRequestProcessor
64 public interface RequestProcessor extends AsyncRequestProcessor, RequestProcessorSpecific {
66 <T> T sync(ReadInterface<T> r) throws DatabaseException;
67 <T> T sync(WriteInterface<T> r) throws DatabaseException;