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.processor;
14 import java.util.ArrayList;
15 import java.util.Collection;
16 import java.util.HashMap;
17 import java.util.HashSet;
18 import java.util.LinkedList;
20 import java.util.UUID;
21 import java.util.concurrent.Semaphore;
22 import java.util.function.Consumer;
24 import org.simantics.db.AsyncReadGraph;
25 import org.simantics.db.AsyncRequestProcessor;
26 import org.simantics.db.ReadGraph;
27 import org.simantics.db.RequestProcessor;
28 import org.simantics.db.Resource;
29 import org.simantics.db.Session;
30 import org.simantics.db.WriteGraph;
31 import org.simantics.db.common.procedure.adapter.AsyncMultiProcedureAdapter;
32 import org.simantics.db.common.procedure.adapter.ProcedureAdapter;
33 import org.simantics.db.common.procedure.wrapper.NoneToAsyncProcedure;
34 import org.simantics.db.common.request.ReadRequest;
35 import org.simantics.db.common.request.WriteRequest;
36 import org.simantics.db.common.utils.Logger;
37 import org.simantics.db.exception.CancelTransactionException;
38 import org.simantics.db.exception.DatabaseException;
39 import org.simantics.db.procedure.AsyncListener;
40 import org.simantics.db.procedure.AsyncMultiListener;
41 import org.simantics.db.procedure.AsyncMultiProcedure;
42 import org.simantics.db.procedure.AsyncProcedure;
43 import org.simantics.db.procedure.Listener;
44 import org.simantics.db.procedure.MultiListener;
45 import org.simantics.db.procedure.MultiProcedure;
46 import org.simantics.db.procedure.Procedure;
47 import org.simantics.db.procedure.SyncListener;
48 import org.simantics.db.procedure.SyncMultiListener;
49 import org.simantics.db.procedure.SyncMultiProcedure;
50 import org.simantics.db.procedure.SyncProcedure;
51 import org.simantics.db.request.AsyncMultiRead;
52 import org.simantics.db.request.AsyncRead;
53 import org.simantics.db.request.DelayedWrite;
54 import org.simantics.db.request.DelayedWriteResult;
55 import org.simantics.db.request.ExternalRead;
56 import org.simantics.db.request.MultiRead;
57 import org.simantics.db.request.Read;
58 import org.simantics.db.request.ReadInterface;
59 import org.simantics.db.request.Write;
60 import org.simantics.db.request.WriteInterface;
61 import org.simantics.db.request.WriteOnly;
62 import org.simantics.db.request.WriteOnlyResult;
63 import org.simantics.db.request.WriteResult;
64 import org.simantics.utils.DataContainer;
65 import org.simantics.utils.datastructures.Pair;
67 public class MergingGraphRequestProcessor implements RequestProcessor {
69 private static class SyncWriteRequestAdapter implements Write {
71 private Semaphore semaphore = new Semaphore(0);
72 private Object request;
73 private Throwable exception;
74 SyncWriteRequestAdapter(Write r) {
77 SyncWriteRequestAdapter(WriteOnly r) {
81 // public GraphRequestStatus perform(Graph g) throws Exception {
82 // return perform((ReadGraph)g);
85 public void perform(WriteGraph g) throws DatabaseException, CancelTransactionException {
86 if(request instanceof Write) {
87 ((Write)request).perform(g);
88 } else if(request instanceof DelayedWrite) {
89 ((DelayedWrite)request).perform(g);
91 ((WriteOnly)request).perform(g);
95 // public String getId() {
96 // if(request instanceof WriteGraphRequest) {
97 // return ((WriteGraphRequest)request).getId();
103 // public void requestCompleted(GraphRequestStatus status) {
104 // if(request instanceof WriteGraphRequest) {
105 // ((WriteGraphRequest)request).requestCompleted(status);
110 // public void handleException(Throwable e) {
111 // this.exception = e;
112 // if(request instanceof WriteGraphRequest) {
113 // ((WriteGraphRequest)request).handleException(e);
117 public void throwOrWrapException() {
118 if (exception == null)
120 if (exception instanceof RuntimeException)
121 throw (RuntimeException) exception;
122 if (exception instanceof Error)
123 throw (Error) exception;
124 throw new RuntimeException("See cause for the real exception.", exception);
127 public void acquire() {
130 } catch (InterruptedException e) {
131 Logger.defaultLogError(e);
135 public void release() {
140 public String toString() {
141 return "SyncWriteRequestAdapter " + request;
146 long transactionKeepalivePeriod;
149 * Synchronization object for implementing {@link #synchronize()}.
150 * {@link Object#notifyAll()} is invoked for this lock object every time a
151 * single transaction is completed, thereby releasing all waiters in
152 * {@link #synchronize()}.
154 Object barrier = new Object();
156 Set<Pair<Object, Object>> requestSet = new HashSet<Pair<Object, Object>>();
157 LinkedList<Pair<Object, Object>> requestQueue = new LinkedList<Pair<Object, Object>>();
158 boolean hasAlreadyRequest = false;
161 * A set of requests which {@link #synchronize()} is depending on at the
162 * moment. Every time a request within this set is completed, some thread in
163 * {@link #synchronize()} should be released.
165 // Set<Object> barrierRequests = new HashSet<Object>();
166 Set<Object> syncRequests = new HashSet<Object>();
170 private AsyncRequestProcessor processor;
172 public MergingGraphRequestProcessor(String name, AsyncRequestProcessor processor, long transactionKeepalivePeriod) {
174 this.processor = processor;
175 this.transactionKeepalivePeriod = transactionKeepalivePeriod;
178 public MergingGraphRequestProcessor(AsyncRequestProcessor processor, long transactionKeepalivePeriod) {
179 this.name = "MergingGraphRequestProcessor" + UUID.randomUUID().toString();
180 this.processor = processor;
181 this.transactionKeepalivePeriod = transactionKeepalivePeriod;
184 @SuppressWarnings({"unchecked", "rawtypes"})
185 protected class MergedRead extends ReadRequest {
187 Pair<Object, Object> currentRequest;
189 // RunnerReadGraphRequest(GraphRequestProcessor processor) {
194 // public void completed(boolean value) {
195 //// System.out.println(this + "MGRP read completed");
196 //// synchronized (MergingGraphRequestProcessor.this) {
197 //// if (requestQueue.isEmpty())
198 //// hasAlreadyRequest = false;
200 //// newTransaction();
205 public void run(ReadGraph graph) {
207 // System.out.println(MergingGraphRequestProcessor.this + " reads");
211 synchronized (MergingGraphRequestProcessor.this) {
213 // Release #synchronize() invokers if necessary.
214 // if (currentRequest != null && barrierRequests.contains(currentRequest)) {
215 // synchronized (barrier) {
216 // barrier.notifyAll();
220 if(requestQueue.isEmpty()) {
221 if (transactionKeepalivePeriod > 0) {
222 // System.out.println("MGRP [" + MergingGraphRequestProcessor.this + "] waits " + transactionKeepalivePeriod + " ms. in " + Thread.currentThread() );
224 MergingGraphRequestProcessor.this.wait(transactionKeepalivePeriod);
225 } catch (InterruptedException e) {
226 Logger.defaultLogError(e);
228 if (requestQueue.isEmpty())
234 Object nextRequest = requestQueue.peekFirst().first;
235 if(nextRequest instanceof Write || nextRequest instanceof DelayedWrite) {
239 currentRequest = requestQueue.remove(0);
240 requestSet.remove(currentRequest);
244 // ReadGraphRequest req = (ReadGraphRequest)currentRequest.first;
246 if( syncRequests.contains(currentRequest.first)) {
250 if(currentRequest.second instanceof AsyncProcedure<?>) {
251 if(currentRequest.first instanceof Read) {
252 Read req = (Read)currentRequest.first;
253 graph.syncRequest(req, (AsyncProcedure<?>)currentRequest.second);
255 AsyncRead req = (AsyncRead)currentRequest.first;
256 graph.syncRequest(req, (AsyncProcedure<?>)currentRequest.second);
259 AsyncMultiRead req = (AsyncMultiRead)currentRequest.first;
260 graph.syncRequest(req, (AsyncMultiProcedure<?>)currentRequest.second);
263 } catch(Throwable t) {
265 Logger.defaultLogError(t);
267 if(currentRequest.second instanceof AsyncProcedure<?>) {
268 ((AsyncProcedure<?>)currentRequest.second).exception(graph, t);
270 ((AsyncMultiProcedure<?>)currentRequest.second).exception(graph, t);
275 synchronized (currentRequest.first) {
276 syncRequests.remove(currentRequest.first);
277 // System.out.println("notifying " + currentRequest.first);
278 currentRequest.first.notify();
286 if(currentRequest.second instanceof AsyncProcedure<?>) {
287 if(currentRequest.first instanceof AsyncRead) {
288 AsyncRead req = (AsyncRead)currentRequest.first;
289 graph.asyncRequest(req, (AsyncProcedure<?>)currentRequest.second);
291 Read req = (Read)currentRequest.first;
292 graph.asyncRequest(req, (AsyncProcedure<?>)currentRequest.second);
295 AsyncMultiRead req = (AsyncMultiRead)currentRequest.first;
296 graph.asyncRequest(req, (AsyncMultiProcedure<?>)currentRequest.second);
299 } catch(Throwable t) {
301 Logger.defaultLogError(t);
303 if(currentRequest.second instanceof AsyncProcedure<?>) {
304 ((AsyncProcedure<?>)currentRequest.second).exception(graph, t);
306 ((AsyncMultiProcedure<?>)currentRequest.second).exception(graph, t);
314 // System.out.println(MergingGraphRequestProcessor.this + " read completed");
316 synchronized (MergingGraphRequestProcessor.this) {
317 if (requestQueue.isEmpty())
318 hasAlreadyRequest = false;
326 public String toString() {
327 return "MergedRead[" + requestQueue.size() + " requests]";
332 protected class RunnerWriteGraphRequest extends WriteRequest {
334 Pair<Object, Object> currentRequest;
335 HashMap<String, String> metadata = new HashMap<String, String>();
338 public void perform(WriteGraph graph) throws DatabaseException {
340 // System.out.println(MergingGraphRequestProcessor.this + " writes");
344 synchronized (MergingGraphRequestProcessor.this) {
346 // Release #synchronize() invokers if necessary.
347 // if (currentRequest != null && barrierRequests.contains(currentRequest)) {
348 // synchronized (barrier) {
349 // barrier.notifyAll();
353 if(requestQueue.isEmpty()) {
354 if (transactionKeepalivePeriod > 0) {
356 MergingGraphRequestProcessor.this.wait(transactionKeepalivePeriod);
357 } catch (InterruptedException e) {
358 Logger.defaultLogError(e);
360 if (requestQueue.isEmpty())
366 Object nextRequest = requestQueue.peekFirst().first;
367 if(nextRequest instanceof AsyncMultiRead || nextRequest instanceof AsyncRead || nextRequest instanceof Read) {
371 currentRequest = requestQueue.remove(0);
372 requestSet.remove(currentRequest);
376 @SuppressWarnings("unchecked")
377 Consumer<Throwable> callback = (Consumer<Throwable>)currentRequest.second;
379 if (currentRequest.first.getClass().equals(SyncWriteRequestAdapter.class)) {
381 SyncWriteRequestAdapter adapter = (SyncWriteRequestAdapter)currentRequest.first;
384 // System.out.println("merg.sync " + adapter);
385 graph.syncRequest(adapter);
386 if(callback != null) callback.accept(null);
387 } catch(Throwable t) {
388 Logger.defaultLogError(t);
389 if(callback != null) callback.accept(t);
393 // System.out.println("merg.sync.release " + adapter);
398 if(currentRequest.first instanceof Write) graph.syncRequest((Write)currentRequest.first);
399 else if(currentRequest.first instanceof DelayedWrite) graph.syncRequest((DelayedWrite)currentRequest.first);
400 if(callback != null) callback.accept(null);
401 } catch(Throwable t) {
402 Logger.defaultLogError(t);
403 if(callback != null) callback.accept(t);
410 // System.out.println(MergingGraphRequestProcessor.this + " write completed");
412 synchronized (MergingGraphRequestProcessor.this) {
413 if (requestQueue.isEmpty())
414 hasAlreadyRequest = false;
423 private void newTransaction() {
425 boolean write = false;
427 synchronized (MergingGraphRequestProcessor.this) {
428 assert(!requestQueue.isEmpty());
429 Object nextRequest = requestQueue.peekFirst().first;
430 write = (nextRequest instanceof Write || nextRequest instanceof DelayedWrite);
434 processor.asyncRequest(new RunnerWriteGraphRequest(), null);
436 processor.asyncRequest(new MergedRead());
442 public <T> void asyncRequest(AsyncMultiRead<T> request, AsyncMultiProcedure<T> procedure) {
444 // System.out.println(this + " asyncRequest(ReadGraphRequest<QueryProcedure4<T>> request, QueryProcedure4<T> procedure)");
446 if (requestSet.contains(request))
449 Pair<Object, Object> pair = new Pair<Object, Object>(request, procedure);
450 requestQueue.add(pair);
451 requestSet.add(pair);
453 if (!hasAlreadyRequest) {
455 hasAlreadyRequest = true;
463 public synchronized <T> void asyncRequest(AsyncRead<T> request, AsyncProcedure<T> procedure) {
465 // System.out.println(this + " asyncRequest(ReadGraphRequest<SingleQueryProcedure4<T>> request, SingleQueryProcedure4<T> procedure) " + this);
467 if (requestSet.contains(request))
470 Pair<Object, Object> pair = new Pair<Object, Object>(request, procedure);
471 requestQueue.add(pair);
472 requestSet.add(pair);
474 if (!hasAlreadyRequest) {
476 hasAlreadyRequest = true;
478 // System.out.println("notify " + this);
485 public synchronized void asyncRequest(Write request, Consumer<DatabaseException> callback) {
487 // System.out.println(this + " asyncRequest(WriteGraphRequest request)");
489 if (requestSet.contains(request))
492 Pair<Object, Object> pair = new Pair<Object, Object>(request, callback);
493 requestQueue.add(pair);
494 requestSet.add(pair);
496 if (!hasAlreadyRequest) {
497 // System.out.println("new transaction");
499 hasAlreadyRequest = true;
501 // System.out.println("notify");
508 public synchronized void asyncRequest(DelayedWrite request, Consumer<DatabaseException> callback) {
510 // System.out.println(this + " asyncRequest(WriteGraphRequest request)");
512 if (requestSet.contains(request))
515 Pair<Object, Object> pair = new Pair<Object, Object>(request, callback);
516 requestQueue.add(pair);
517 requestSet.add(pair);
519 if (!hasAlreadyRequest) {
520 // System.out.println("new transaction");
522 hasAlreadyRequest = true;
524 // System.out.println("notify");
531 public synchronized void asyncRequest(WriteOnly request, Consumer<DatabaseException> callback) {
533 // System.out.println(this + " asyncRequest(WriteGraphRequest request)");
535 if (requestSet.contains(request))
538 Pair<Object, Object> pair = new Pair<Object, Object>(request, callback);
539 requestQueue.add(pair);
540 requestSet.add(pair);
542 if (!hasAlreadyRequest) {
543 // System.out.println("new transaction");
545 hasAlreadyRequest = true;
547 // System.out.println("notify");
554 public <T> Collection<T> syncRequest(AsyncMultiRead<T> request, final AsyncMultiProcedure<T> procedure) {
556 final DataContainer<Throwable> throwable = new DataContainer<Throwable>(null);
558 // Queue the adapter up for execution.
559 synchronized (request) {
560 syncRequests.add(request);
561 asyncRequest(request, procedure);
562 if(syncRequests.contains(request)) {
564 // System.out.println("waiting " + request);
566 } catch (InterruptedException e) {
572 Throwable t = throwable.get();
575 Logger.defaultLogError(t);
576 throw new RuntimeException(t.getMessage());
584 public <T> T syncRequest(AsyncRead<T> request, final AsyncProcedure<T> procedure) {
586 // System.out.println("syncRequest(ReadGraphRequest<SingleQueryProcedure4<T>> request, SingleQueryProcedure4<T> procedure)");
588 final DataContainer<T> result = new DataContainer<T>(null);
589 final DataContainer<Throwable> throwable = new DataContainer<Throwable>(null);
591 // Queue the adapter up for execution.
592 synchronized (request) {
594 syncRequests.add(request);
595 asyncRequest(request, new AsyncProcedure<T>() {
597 public void execute(AsyncReadGraph graph, T t) {
598 synchronized(result) {
601 procedure.execute(graph, t);
605 public void exception(AsyncReadGraph graph, Throwable t) {
610 public String toString() {
611 return procedure.toString();
615 if(syncRequests.contains(request)) {
617 // System.out.println("waiting " + request);
619 } catch (InterruptedException e) {
625 Throwable t = throwable.get();
628 Logger.defaultLogError(t);
629 throw new RuntimeException(t.getMessage());
634 //return result.get();
640 public void syncRequest(Write request) {
642 // System.out.println(MergingGraphRequestProcessor.this + " syncRequest(WriteGraphRequest)");
644 SyncWriteRequestAdapter adapter = new SyncWriteRequestAdapter(request);
646 asyncRequest(adapter, null);
650 // Throw exception if one occurred.
651 adapter.throwOrWrapException();
656 public void syncRequest(WriteOnly request) {
658 // System.out.println(MergingGraphRequestProcessor.this + " syncRequest(WriteGraphRequest)");
660 SyncWriteRequestAdapter adapter = new SyncWriteRequestAdapter(request);
662 // Queue the adapter up for execution.
663 synchronized (adapter) {
664 asyncRequest(adapter, null);
667 } catch (InterruptedException e) {
672 // Throw exception if one occurred.
673 adapter.throwOrWrapException();
678 public Session getSession() {
679 return processor.getSession();
683 public String toString() {
684 return "MergingGraphRequestProcessor[" + name + "]@" + System.identityHashCode(this) + " (based on " + processor + ")";
688 public <T> void asyncRequest(AsyncRead<T> request) {
690 asyncRequest(request, new ProcedureAdapter<T>() {
693 public void exception(Throwable t) {
694 Logger.defaultLogError(t);
702 public <T> void asyncRequest(AsyncRead<T> request, Procedure<T> procedure) {
703 asyncRequest(request, new NoneToAsyncProcedure<T>(procedure));
707 public <T> void asyncRequest(AsyncMultiRead<T> request) {
708 throw new UnsupportedOperationException("Not implemented.");
712 public <T> void asyncRequest(AsyncMultiRead<T> request,
713 MultiProcedure<T> procedure) {
714 throw new UnsupportedOperationException("Not implemented.");
718 public <T> T syncRequest(AsyncRead<T> request) {
720 final DataContainer<Throwable> throwable = new DataContainer<Throwable>(null);
721 final DataContainer<T> result = new DataContainer<T>();
723 syncRequest(request, new AsyncProcedure<T>() {
725 public void execute(AsyncReadGraph graph, T t) {
730 public void exception(AsyncReadGraph graph, Throwable t) {
736 Throwable t = throwable.get();
739 Logger.defaultLogError(t);
740 throw new RuntimeException(t.getMessage());
748 public <T> T syncRequest(AsyncRead<T> request,
749 Procedure<T> procedure) {
750 throw new UnsupportedOperationException("Not implemented.");
754 public <T> Collection<T> syncRequest(AsyncMultiRead<T> request) {
756 final DataContainer<Throwable> throwable = new DataContainer<Throwable>(null);
757 final ArrayList<T> result = new ArrayList<T>();
759 syncRequest(request, new AsyncMultiProcedureAdapter<T>() {
762 public void execute(AsyncReadGraph graph, T t) {
763 synchronized(result) {
769 public void exception(AsyncReadGraph graph, Throwable t) {
775 Throwable t = throwable.get();
778 Logger.defaultLogError(t);
779 throw new RuntimeException(t.getMessage());
787 public <T> Collection<T> syncRequest(AsyncMultiRead<T> request,
788 MultiProcedure<T> procedure) {
789 throw new Error("Not implemented.");
793 public <T> T syncRequest(Read<T> request) {
795 final DataContainer<Throwable> throwable = new DataContainer<Throwable>(null);
796 final DataContainer<T> result = new DataContainer<T>();
799 syncRequest(request, new Procedure<T>() {
801 public void execute(T t) {
806 public void exception(Throwable t) {
812 Throwable t = throwable.get();
815 throw new Error(t.getMessage());
824 public <T> T syncRequest(Read<T> request,
825 final AsyncProcedure<T> procedure) {
827 final DataContainer<T> result = new DataContainer<T>(null);
828 final DataContainer<Throwable> throwable = new DataContainer<Throwable>(null);
830 // Queue the adapter up for execution.
831 synchronized (request) {
833 syncRequests.add(request);
834 asyncRequest(request, new AsyncProcedure<T>() {
836 public void execute(AsyncReadGraph graph, T t) {
837 synchronized(result) {
840 procedure.execute(graph, t);
844 public void exception(AsyncReadGraph graph, Throwable t) {
849 public String toString() {
850 return procedure.toString();
854 if(syncRequests.contains(request)) {
856 // System.out.println("waiting " + request);
858 } catch (InterruptedException e) {
864 Throwable t = throwable.get();
867 throw new RuntimeException("Unexpected exception in MergingGraphRequestProcessor.syncRequest(Read, AsyncProcedure)", t);
875 public <T> void asyncRequest(Read<T> request) {
877 asyncRequest(request, new ProcedureAdapter<T>() {
880 public void exception(Throwable t) {
881 Logger.defaultLogError(t);
889 public synchronized <T> void asyncRequest(Read<T> request,
890 AsyncProcedure<T> procedure) {
892 if (requestSet.contains(request))
895 Pair<Object, Object> pair = new Pair<Object, Object>(request, procedure);
896 requestQueue.add(pair);
897 requestSet.add(pair);
899 if (!hasAlreadyRequest) {
901 hasAlreadyRequest = true;
909 public <T> T syncRequest(Read<T> request, Procedure<T> procedure) {
910 return syncRequest(request, new NoneToAsyncProcedure<T>(procedure));
914 public <T> Collection<T> syncRequest(final MultiRead<T> request) throws DatabaseException {
915 assert(request != null);
917 final ArrayList<T> result = new ArrayList<T>();
918 final DataContainer<Throwable> exception = new DataContainer<Throwable>();
920 syncRequest(request, new AsyncMultiProcedureAdapter<T>() {
923 public void execute(AsyncReadGraph graph, T t) {
924 synchronized(result) {
930 public void exception(AsyncReadGraph graph, Throwable t) {
935 public String toString() {
936 return "syncRequest(MultiRead) -> " + request;
941 Throwable t = exception.get();
943 if(t instanceof DatabaseException) throw (DatabaseException)t;
944 else throw new DatabaseException("Unexpected exception in ReadGraph.syncRequest(Read)", t);
951 public <T> Collection<T> syncRequest(MultiRead<T> request, AsyncMultiProcedure<T> procedure) {
952 throw new UnsupportedOperationException("Not implemented");
956 public <T> Collection<T> syncRequest(MultiRead<T> request, MultiProcedure<T> procedure) {
957 throw new UnsupportedOperationException("Not implemented");
961 public <T> void asyncRequest(Read<T> request, Procedure<T> procedure) {
962 asyncRequest(request, new NoneToAsyncProcedure<T>(procedure));
966 public <T> void asyncRequest(MultiRead<T> request) {
967 throw new UnsupportedOperationException("Not implemented");
971 public <T> void asyncRequest(MultiRead<T> request, AsyncMultiProcedure<T> procedure) {
972 throw new UnsupportedOperationException("Not implemented");
976 public <T> void asyncRequest(MultiRead<T> request, MultiProcedure<T> procedure) {
977 throw new UnsupportedOperationException("Not implemented");
981 public void asyncRequest(Write r) {
982 asyncRequest(r, null);
986 public void asyncRequest(DelayedWrite r) {
987 asyncRequest(r, null);
991 public void asyncRequest(WriteOnly r) {
992 asyncRequest(r, null);
996 public <T> T getService(Class<T> api) {
997 return getSession().getService(api);
1001 public <T> T peekService(Class<T> api) {
1002 return getSession().peekService(api);
1006 public boolean hasService(Class<?> api) {
1007 return getSession().hasService(api);
1011 public <T> void registerService(Class<T> api, T service) {
1012 getSession().registerService(api, service);
1016 // public <T> T syncRequest(Read<T> arg0, AsyncListener<T> arg1) {
1017 // throw new UnsupportedOperationException("Not implemented.");
1021 public <T> T syncRequest(Read<T> arg0, SyncListener<T> arg1) {
1022 throw new UnsupportedOperationException("Not implemented.");
1026 public <T> T syncRequest(Read<T> arg0, Listener<T> arg1) {
1027 throw new UnsupportedOperationException("Not implemented.");
1031 public <T> T syncRequest(Read<T> arg0, SyncProcedure<T> arg1) {
1032 throw new UnsupportedOperationException("Not implemented.");
1036 public <T> T syncRequest(AsyncRead<T> arg0, AsyncListener<T> arg1) {
1037 throw new UnsupportedOperationException("Not implemented.");
1041 public <T> T syncRequest(AsyncRead<T> arg0, SyncListener<T> arg1) {
1042 throw new UnsupportedOperationException("Not implemented.");
1047 public <T> T syncRequest(AsyncRead<T> arg0, Listener<T> arg1) {
1048 throw new UnsupportedOperationException("Not implemented.");
1053 public <T> T syncRequest(AsyncRead<T> arg0, SyncProcedure<T> arg1) {
1054 throw new UnsupportedOperationException("Not implemented.");
1059 public <T> void asyncRequest(Read<T> arg0, AsyncListener<T> arg1) {
1060 throw new UnsupportedOperationException("Not implemented.");
1065 public <T> void asyncRequest(Read<T> arg0, SyncListener<T> arg1) {
1066 throw new UnsupportedOperationException("Not implemented.");
1071 public <T> void asyncRequest(Read<T> arg0, Listener<T> arg1) {
1072 throw new UnsupportedOperationException("Not implemented.");
1077 public <T> void asyncRequest(Read<T> arg0, SyncProcedure<T> arg1) {
1078 throw new UnsupportedOperationException("Not implemented.");
1083 public <T> void asyncRequest(AsyncRead<T> arg0, AsyncListener<T> arg1) {
1084 throw new UnsupportedOperationException("Not implemented.");
1089 public <T> void asyncRequest(AsyncRead<T> arg0, SyncListener<T> arg1) {
1090 throw new UnsupportedOperationException("Not implemented.");
1095 public <T> void asyncRequest(AsyncRead<T> arg0, Listener<T> arg1) {
1096 throw new UnsupportedOperationException("Not implemented.");
1101 public <T> void asyncRequest(AsyncRead<T> arg0, SyncProcedure<T> arg1) {
1102 throw new UnsupportedOperationException("Not implemented.");
1107 public <T> Collection<T> syncRequest(MultiRead<T> arg0, AsyncMultiListener<T> arg1) {
1108 throw new UnsupportedOperationException("Not implemented.");
1113 public <T> Collection<T> syncRequest(MultiRead<T> arg0, SyncMultiListener<T> arg1) {
1114 throw new UnsupportedOperationException("Not implemented.");
1119 public <T> Collection<T> syncRequest(MultiRead<T> arg0, MultiListener<T> arg1) {
1120 throw new UnsupportedOperationException("Not implemented.");
1125 public <T> Collection<T> syncRequest(MultiRead<T> arg0, SyncMultiProcedure<T> arg1) {
1126 throw new UnsupportedOperationException("Not implemented.");
1131 public <T> Collection<T> syncRequest(AsyncMultiRead<T> arg0,
1132 AsyncMultiListener<T> arg1) {
1133 throw new UnsupportedOperationException("Not implemented.");
1138 public <T> Collection<T> syncRequest(AsyncMultiRead<T> arg0, SyncMultiListener<T> arg1) {
1139 throw new UnsupportedOperationException("Not implemented.");
1144 public <T> Collection<T> syncRequest(AsyncMultiRead<T> arg0,
1145 MultiListener<T> arg1) {
1146 throw new UnsupportedOperationException("Not implemented.");
1151 public <T> Collection<T> syncRequest(AsyncMultiRead<T> arg0, SyncMultiProcedure<T> arg1) {
1152 throw new UnsupportedOperationException("Not implemented.");
1157 public <T> void asyncRequest(MultiRead<T> arg0, AsyncMultiListener<T> arg1) {
1158 throw new UnsupportedOperationException("Not implemented.");
1163 public <T> void asyncRequest(MultiRead<T> arg0, SyncMultiListener<T> arg1) {
1164 throw new UnsupportedOperationException("Not implemented.");
1169 public <T> void asyncRequest(MultiRead<T> arg0, MultiListener<T> arg1) {
1170 throw new UnsupportedOperationException("Not implemented.");
1175 public <T> void asyncRequest(MultiRead<T> arg0, SyncMultiProcedure<T> arg1) {
1176 throw new UnsupportedOperationException("Not implemented.");
1181 public <T> void asyncRequest(AsyncMultiRead<T> arg0,
1182 AsyncMultiListener<T> arg1) {
1183 throw new UnsupportedOperationException("Not implemented.");
1187 public <T> void asyncRequest(AsyncMultiRead<T> arg0, SyncMultiListener<T> arg1) {
1188 throw new UnsupportedOperationException("Not implemented.");
1193 public <T> void asyncRequest(AsyncMultiRead<T> arg0,
1194 MultiListener<T> arg1) {
1195 throw new UnsupportedOperationException("Not implemented.");
1200 public <T> void asyncRequest(AsyncMultiRead<T> arg0, SyncMultiProcedure<T> arg1) {
1201 throw new UnsupportedOperationException("Not implemented.");
1205 public <T> void asyncRequest(ExternalRead<T> request, Procedure<T> procedure) {
1206 throw new UnsupportedOperationException("Not implemented.");
1210 public <T> T syncRequest(ExternalRead<T> request) {
1211 throw new UnsupportedOperationException("Not implemented.");
1215 public <T> T syncRequest(ExternalRead<T> request, Listener<T> procedure) {
1216 throw new UnsupportedOperationException("Not implemented.");
1220 public <T> T syncRequest(ExternalRead<T> request, Procedure<T> procedure) {
1221 throw new UnsupportedOperationException("Not implemented.");
1225 public <T> void asyncRequest(ExternalRead<T> request) {
1226 throw new UnsupportedOperationException("Not implemented.");
1230 public <T> void asyncRequest(ExternalRead<T> request, Listener<T> procedure) {
1231 throw new UnsupportedOperationException("Not implemented.");
1235 public void syncRequest(DelayedWrite request) throws DatabaseException {
1236 throw new UnsupportedOperationException("Not implemented.");
1240 public <T> T syncRequest(WriteResult<T> request) throws DatabaseException {
1241 throw new UnsupportedOperationException();
1245 public <T> T syncRequest(DelayedWriteResult<T> request)
1246 throws DatabaseException {
1247 throw new UnsupportedOperationException();
1251 public <T> T syncRequest(WriteOnlyResult<T> r) throws DatabaseException {
1252 throw new UnsupportedOperationException();
1256 public <T> void asyncRequest(WriteResult<T> r, Procedure<T> procedure) {
1257 throw new UnsupportedOperationException();
1261 public <T> void asyncRequest(DelayedWriteResult<T> r, Procedure<T> procedure) {
1262 throw new UnsupportedOperationException();
1266 public <T> void asyncRequest(WriteOnlyResult<T> r, Procedure<T> procedure) {
1267 throw new UnsupportedOperationException();
1271 public Resource getRootLibrary() {
1272 return processor.getRootLibrary();
1276 public <T> void async(ReadInterface<T> r, Procedure<T> procedure) {
1277 throw new UnsupportedOperationException();
1281 public <T> void async(ReadInterface<T> r, AsyncProcedure<T> procedure) {
1282 throw new UnsupportedOperationException();
1286 public <T> void async(ReadInterface<T> r, SyncProcedure<T> procedure) {
1287 throw new UnsupportedOperationException();
1291 public <T> void async(ReadInterface<T> r, Listener<T> procedure) {
1292 throw new UnsupportedOperationException();
1296 public <T> void async(ReadInterface<T> r, AsyncListener<T> procedure) {
1297 throw new UnsupportedOperationException();
1301 public <T> void async(ReadInterface<T> r, SyncListener<T> procedure) {
1302 throw new UnsupportedOperationException();
1306 public <T> T sync(ReadInterface<T> r) throws DatabaseException {
1307 throw new UnsupportedOperationException();
1311 public <T> T sync(WriteInterface<T> r) throws DatabaseException {
1312 throw new UnsupportedOperationException();
1316 public <T> void async(WriteInterface<T> r, Procedure<T> procedure) {
1317 throw new UnsupportedOperationException();
1321 public <T> void async(WriteInterface<T> r) {
1322 throw new UnsupportedOperationException();
1326 public Object getModificationCounter() {
1327 throw new UnsupportedOperationException();