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.common.request;
14 import org.simantics.db.AsyncRequestProcessor;
15 import org.simantics.db.RequestProcessor;
16 import org.simantics.db.exception.DatabaseException;
17 import org.simantics.db.procedure.AsyncListener;
18 import org.simantics.db.procedure.AsyncProcedure;
19 import org.simantics.db.procedure.Listener;
20 import org.simantics.db.procedure.Procedure;
21 import org.simantics.db.procedure.SyncListener;
22 import org.simantics.db.procedure.SyncProcedure;
23 import org.simantics.db.request.Read;
24 import org.simantics.db.request.ReadInterface;
26 public abstract class UniqueRead<R> implements Read<R>, ReadInterface<R> {
29 public void request(AsyncRequestProcessor processor, AsyncProcedure<R> procedure) {
30 processor.asyncRequest(this, procedure);
34 public void request(AsyncRequestProcessor processor, Procedure<R> procedure) {
35 processor.asyncRequest(this, procedure);
39 public void request(AsyncRequestProcessor processor, SyncProcedure<R> procedure) {
40 processor.asyncRequest(this, procedure);
44 public void request(AsyncRequestProcessor processor, AsyncListener<R> procedure) {
45 processor.asyncRequest(this, procedure);
49 public void request(AsyncRequestProcessor processor, Listener<R> procedure) {
50 processor.asyncRequest(this, procedure);
54 public void request(AsyncRequestProcessor processor, SyncListener<R> procedure) {
55 processor.asyncRequest(this, procedure);
59 public R request(RequestProcessor processor) throws DatabaseException {
60 return processor.syncRequest(this);