1 /*******************************************************************************
2 * Copyright (c) 2007, 2018 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.Resource;
28 import org.simantics.db.Session;
29 import org.simantics.db.WriteGraph;
30 import org.simantics.db.common.procedure.adapter.AsyncMultiProcedureAdapter;
31 import org.simantics.db.common.procedure.adapter.ProcedureAdapter;
32 import org.simantics.db.common.procedure.adapter.SyncMultiProcedureAdapter;
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.exception.CancelTransactionException;
37 import org.simantics.db.exception.DatabaseException;
38 import org.simantics.db.procedure.AsyncListener;
39 import org.simantics.db.procedure.AsyncMultiListener;
40 import org.simantics.db.procedure.AsyncMultiProcedure;
41 import org.simantics.db.procedure.AsyncProcedure;
42 import org.simantics.db.procedure.Listener;
43 import org.simantics.db.procedure.MultiListener;
44 import org.simantics.db.procedure.MultiProcedure;
45 import org.simantics.db.procedure.Procedure;
46 import org.simantics.db.procedure.SyncListener;
47 import org.simantics.db.procedure.SyncMultiListener;
48 import org.simantics.db.procedure.SyncMultiProcedure;
49 import org.simantics.db.procedure.SyncProcedure;
50 import org.simantics.db.request.AsyncMultiRead;
51 import org.simantics.db.request.AsyncRead;
52 import org.simantics.db.request.DelayedWrite;
53 import org.simantics.db.request.DelayedWriteResult;
54 import org.simantics.db.request.ExternalRead;
55 import org.simantics.db.request.MultiRead;
56 import org.simantics.db.request.Read;
57 import org.simantics.db.request.ReadInterface;
58 import org.simantics.db.request.Write;
59 import org.simantics.db.request.WriteInterface;
60 import org.simantics.db.request.WriteOnly;
61 import org.simantics.db.request.WriteOnlyResult;
62 import org.simantics.db.request.WriteResult;
63 import org.simantics.utils.DataContainer;
64 import org.simantics.utils.datastructures.Pair;
65 import org.slf4j.Logger;
66 import org.slf4j.LoggerFactory;
68 public class MergingGraphRequestProcessor implements AsyncRequestProcessor {
70 private static final Logger LOGGER = LoggerFactory.getLogger(MergingGraphRequestProcessor.class);
72 private static class SyncWriteRequestAdapter implements Write {
74 private Semaphore semaphore = new Semaphore(0);
75 private Object request;
76 private Throwable exception;
77 SyncWriteRequestAdapter(Write r) {
80 SyncWriteRequestAdapter(WriteOnly r) {
84 // public GraphRequestStatus perform(Graph g) throws Exception {
85 // return perform((ReadGraph)g);
88 public void perform(WriteGraph g) throws DatabaseException, CancelTransactionException {
89 if(request instanceof Write) {
90 ((Write)request).perform(g);
91 } else if(request instanceof DelayedWrite) {
92 ((DelayedWrite)request).perform(g);
94 ((WriteOnly)request).perform(g);
98 // public String getId() {
99 // if(request instanceof WriteGraphRequest) {
100 // return ((WriteGraphRequest)request).getId();
106 // public void requestCompleted(GraphRequestStatus status) {
107 // if(request instanceof WriteGraphRequest) {
108 // ((WriteGraphRequest)request).requestCompleted(status);
113 // public void handleException(Throwable e) {
114 // this.exception = e;
115 // if(request instanceof WriteGraphRequest) {
116 // ((WriteGraphRequest)request).handleException(e);
120 public void throwOrWrapException() {
121 if (exception == null)
123 if (exception instanceof RuntimeException)
124 throw (RuntimeException) exception;
125 if (exception instanceof Error)
126 throw (Error) exception;
127 throw new RuntimeException("See cause for the real exception.", exception);
130 public void acquire() {
133 } catch (InterruptedException e) {
134 LOGGER.error("SyncWriteRequestAdapter interrupted", e);
138 public void release() {
143 public String toString() {
144 return "SyncWriteRequestAdapter " + request;
149 long transactionKeepalivePeriod;
152 * Synchronization object for implementing {@link #synchronize()}.
153 * {@link Object#notifyAll()} is invoked for this lock object every time a
154 * single transaction is completed, thereby releasing all waiters in
155 * {@link #synchronize()}.
157 Object barrier = new Object();
159 Set<Pair<Object, Object>> requestSet = new HashSet<Pair<Object, Object>>();
160 LinkedList<Pair<Object, Object>> requestQueue = new LinkedList<Pair<Object, Object>>();
161 boolean hasAlreadyRequest = false;
164 * A set of requests which {@link #synchronize()} is depending on at the
165 * moment. Every time a request within this set is completed, some thread in
166 * {@link #synchronize()} should be released.
168 // Set<Object> barrierRequests = new HashSet<Object>();
169 Set<Object> syncRequests = new HashSet<Object>();
173 private AsyncRequestProcessor processor;
175 public MergingGraphRequestProcessor(String name, AsyncRequestProcessor processor, long transactionKeepalivePeriod) {
177 this.processor = processor;
178 this.transactionKeepalivePeriod = transactionKeepalivePeriod;
181 public MergingGraphRequestProcessor(AsyncRequestProcessor processor, long transactionKeepalivePeriod) {
182 this.name = "MergingGraphRequestProcessor" + UUID.randomUUID().toString();
183 this.processor = processor;
184 this.transactionKeepalivePeriod = transactionKeepalivePeriod;
187 @SuppressWarnings({"unchecked", "rawtypes"})
188 protected class MergedRead extends ReadRequest {
190 Pair<Object, Object> currentRequest;
192 // RunnerReadGraphRequest(GraphRequestProcessor processor) {
197 // public void completed(boolean value) {
198 //// System.out.println(this + "MGRP read completed");
199 //// synchronized (MergingGraphRequestProcessor.this) {
200 //// if (requestQueue.isEmpty())
201 //// hasAlreadyRequest = false;
203 //// newTransaction();
208 public void run(ReadGraph graph) {
210 // System.out.println(MergingGraphRequestProcessor.this + " reads");
214 synchronized (MergingGraphRequestProcessor.this) {
216 // Release #synchronize() invokers if necessary.
217 // if (currentRequest != null && barrierRequests.contains(currentRequest)) {
218 // synchronized (barrier) {
219 // barrier.notifyAll();
223 if(requestQueue.isEmpty()) {
224 if (transactionKeepalivePeriod > 0) {
225 // System.out.println("MGRP [" + MergingGraphRequestProcessor.this + "] waits " + transactionKeepalivePeriod + " ms. in " + Thread.currentThread() );
227 MergingGraphRequestProcessor.this.wait(transactionKeepalivePeriod);
228 } catch (InterruptedException e) {
229 LOGGER.error("MergedRead interrupted", e);
231 if (requestQueue.isEmpty())
237 Object nextRequest = requestQueue.peekFirst().first;
238 if(nextRequest instanceof Write || nextRequest instanceof DelayedWrite) {
242 currentRequest = requestQueue.remove(0);
243 requestSet.remove(currentRequest);
247 // ReadGraphRequest req = (ReadGraphRequest)currentRequest.first;
249 if( syncRequests.contains(currentRequest.first)) {
253 if(currentRequest.second instanceof AsyncProcedure<?>) {
254 if(currentRequest.first instanceof Read) {
255 Read req = (Read)currentRequest.first;
256 graph.syncRequest(req, (AsyncProcedure<?>)currentRequest.second);
258 AsyncRead req = (AsyncRead)currentRequest.first;
259 graph.syncRequest(req, (AsyncProcedure<?>)currentRequest.second);
262 AsyncMultiRead req = (AsyncMultiRead)currentRequest.first;
263 graph.syncRequest(req, (AsyncMultiProcedure<?>)currentRequest.second);
266 } catch(Throwable t) {
268 LOGGER.error("MergedRead failed", t);
270 // if(currentRequest.second instanceof AsyncProcedure<?>) {
271 // ((AsyncProcedure<?>)currentRequest.second).exception(graph, t);
273 // ((AsyncMultiProcedure<?>)currentRequest.second).exception(graph, t);
278 synchronized (currentRequest.first) {
279 syncRequests.remove(currentRequest.first);
280 // System.out.println("notifying " + currentRequest.first);
281 currentRequest.first.notify();
289 if(currentRequest.second instanceof AsyncProcedure<?>) {
290 if(currentRequest.first instanceof AsyncRead) {
291 AsyncRead req = (AsyncRead)currentRequest.first;
292 graph.syncRequest(req, (AsyncProcedure<?>)currentRequest.second);
294 Read req = (Read)currentRequest.first;
295 graph.syncRequest(req, (AsyncProcedure<?>)currentRequest.second);
298 AsyncMultiRead req = (AsyncMultiRead)currentRequest.first;
299 graph.syncRequest(req, (AsyncMultiProcedure<?>)currentRequest.second);
302 } catch(Throwable t) {
304 LOGGER.error("MergedRead failed", t);
306 // if(currentRequest.second instanceof AsyncProcedure<?>) {
307 // ((AsyncProcedure<?>)currentRequest.second).exception(graph, t);
309 // ((AsyncMultiProcedure<?>)currentRequest.second).exception(graph, t);
317 // System.out.println(MergingGraphRequestProcessor.this + " read completed");
319 synchronized (MergingGraphRequestProcessor.this) {
320 if (requestQueue.isEmpty())
321 hasAlreadyRequest = false;
329 public String toString() {
330 return "MergedRead[" + requestQueue.size() + " requests]";
335 protected class RunnerWriteGraphRequest extends WriteRequest {
337 Pair<Object, Object> currentRequest;
338 HashMap<String, String> metadata = new HashMap<String, String>();
341 public void perform(WriteGraph graph) throws DatabaseException {
343 // System.out.println(MergingGraphRequestProcessor.this + " writes");
347 synchronized (MergingGraphRequestProcessor.this) {
349 // Release #synchronize() invokers if necessary.
350 // if (currentRequest != null && barrierRequests.contains(currentRequest)) {
351 // synchronized (barrier) {
352 // barrier.notifyAll();
356 if(requestQueue.isEmpty()) {
357 if (transactionKeepalivePeriod > 0) {
359 MergingGraphRequestProcessor.this.wait(transactionKeepalivePeriod);
360 } catch (InterruptedException e) {
361 LOGGER.error("RunnerWriteGraphRequest interrupted", e);
363 if (requestQueue.isEmpty())
369 Object nextRequest = requestQueue.peekFirst().first;
370 if(nextRequest instanceof AsyncMultiRead || nextRequest instanceof AsyncRead || nextRequest instanceof Read) {
374 currentRequest = requestQueue.remove(0);
375 requestSet.remove(currentRequest);
379 @SuppressWarnings("unchecked")
380 Consumer<Throwable> callback = (Consumer<Throwable>)currentRequest.second;
382 if (currentRequest.first.getClass().equals(SyncWriteRequestAdapter.class)) {
384 SyncWriteRequestAdapter adapter = (SyncWriteRequestAdapter)currentRequest.first;
387 // System.out.println("merg.sync " + adapter);
388 graph.syncRequest(adapter);
389 if(callback != null) callback.accept(null);
390 } catch(Throwable t) {
391 LOGGER.error("RunnerWriteGraphRequest failed", t);
392 if(callback != null) callback.accept(t);
396 // System.out.println("merg.sync.release " + adapter);
401 if(currentRequest.first instanceof Write) graph.syncRequest((Write)currentRequest.first);
402 else if(currentRequest.first instanceof DelayedWrite) graph.syncRequest((DelayedWrite)currentRequest.first);
403 if(callback != null) callback.accept(null);
404 } catch(Throwable t) {
405 LOGGER.error("RunnerWriteGraphRequest failed", t);
406 if(callback != null) callback.accept(t);
413 // System.out.println(MergingGraphRequestProcessor.this + " write completed");
415 synchronized (MergingGraphRequestProcessor.this) {
416 if (requestQueue.isEmpty())
417 hasAlreadyRequest = false;
426 private void newTransaction() {
428 boolean write = false;
430 synchronized (MergingGraphRequestProcessor.this) {
431 assert(!requestQueue.isEmpty());
432 Object nextRequest = requestQueue.peekFirst().first;
433 write = (nextRequest instanceof Write || nextRequest instanceof DelayedWrite);
437 processor.asyncRequest(new RunnerWriteGraphRequest(), null);
439 processor.asyncRequest(new MergedRead());
445 public <T> void asyncRequest(AsyncMultiRead<T> request, AsyncMultiProcedure<T> procedure) {
447 // System.out.println(this + " asyncRequest(ReadGraphRequest<QueryProcedure4<T>> request, QueryProcedure4<T> procedure)");
449 Pair<Object, Object> pair = Pair.make(request, procedure);
450 if (requestSet.contains(pair))
453 requestQueue.add(pair);
454 requestSet.add(pair);
456 if (!hasAlreadyRequest) {
458 hasAlreadyRequest = true;
466 public synchronized <T> void asyncRequest(AsyncRead<T> request, AsyncProcedure<T> procedure) {
468 // System.out.println(this + " asyncRequest(ReadGraphRequest<SingleQueryProcedure4<T>> request, SingleQueryProcedure4<T> procedure) " + this);
470 Pair<Object, Object> pair = Pair.make(request, procedure);
471 if (requestSet.contains(pair))
474 requestQueue.add(pair);
475 requestSet.add(pair);
477 if (!hasAlreadyRequest) {
479 hasAlreadyRequest = true;
481 // System.out.println("notify " + this);
488 public synchronized void asyncRequest(Write request, Consumer<DatabaseException> callback) {
490 // System.out.println(this + " asyncRequest(WriteGraphRequest request)");
492 Pair<Object, Object> pair = Pair.make(request, callback);
493 if (requestSet.contains(pair))
496 requestQueue.add(pair);
497 requestSet.add(pair);
499 if (!hasAlreadyRequest) {
500 // System.out.println("new transaction");
502 hasAlreadyRequest = true;
504 // System.out.println("notify");
511 public synchronized void asyncRequest(DelayedWrite request, Consumer<DatabaseException> callback) {
513 // System.out.println(this + " asyncRequest(WriteGraphRequest request)");
515 Pair<Object, Object> pair = Pair.make(request, callback);
516 if (requestSet.contains(pair))
519 requestQueue.add(pair);
520 requestSet.add(pair);
522 if (!hasAlreadyRequest) {
523 // System.out.println("new transaction");
525 hasAlreadyRequest = true;
527 // System.out.println("notify");
534 public synchronized void asyncRequest(WriteOnly request, Consumer<DatabaseException> callback) {
536 // System.out.println(this + " asyncRequest(WriteGraphRequest request)");
538 Pair<Object, Object> pair = Pair.make(request, callback);
539 if (requestSet.contains(pair))
542 requestQueue.add(pair);
543 requestSet.add(pair);
545 if (!hasAlreadyRequest) {
546 // System.out.println("new transaction");
548 hasAlreadyRequest = true;
550 // System.out.println("notify");
557 public <T> Collection<T> syncRequest(AsyncMultiRead<T> request, final AsyncMultiProcedure<T> procedure) {
559 final DataContainer<Throwable> throwable = new DataContainer<Throwable>(null);
561 // Queue the adapter up for execution.
562 synchronized (request) {
563 syncRequests.add(request);
564 asyncRequest(request, procedure);
565 if(syncRequests.contains(request)) {
567 // System.out.println("waiting " + request);
569 } catch (InterruptedException e) {
575 Throwable t = throwable.get();
578 LOGGER.error("syncRequest(AsyncMultiRead, AsyncMultiProcedure) failed", t);
579 throw new RuntimeException(t.getMessage());
587 public <T> T syncRequest(AsyncRead<T> request, final AsyncProcedure<T> procedure) {
589 // System.out.println("syncRequest(ReadGraphRequest<SingleQueryProcedure4<T>> request, SingleQueryProcedure4<T> procedure)");
591 final DataContainer<T> result = new DataContainer<T>(null);
592 final DataContainer<Throwable> throwable = new DataContainer<Throwable>(null);
594 // Queue the adapter up for execution.
595 synchronized (request) {
597 syncRequests.add(request);
598 asyncRequest(request, new AsyncProcedure<T>() {
600 public void execute(AsyncReadGraph graph, T t) {
601 synchronized(result) {
604 procedure.execute(graph, t);
608 public void exception(AsyncReadGraph graph, Throwable t) {
613 public String toString() {
614 return procedure.toString();
618 if(syncRequests.contains(request)) {
620 // System.out.println("waiting " + request);
622 } catch (InterruptedException e) {
628 Throwable t = throwable.get();
631 LOGGER.error("syncRequest(AsyncRead, AsyncProcedure) failed", t);
632 throw new RuntimeException(t.getMessage());
637 //return result.get();
643 public void syncRequest(Write request) {
645 // System.out.println(MergingGraphRequestProcessor.this + " syncRequest(WriteGraphRequest)");
647 SyncWriteRequestAdapter adapter = new SyncWriteRequestAdapter(request);
649 asyncRequest(adapter, null);
653 // Throw exception if one occurred.
654 adapter.throwOrWrapException();
659 public void syncRequest(WriteOnly request) {
661 // System.out.println(MergingGraphRequestProcessor.this + " syncRequest(WriteGraphRequest)");
663 SyncWriteRequestAdapter adapter = new SyncWriteRequestAdapter(request);
665 // Queue the adapter up for execution.
666 synchronized (adapter) {
667 asyncRequest(adapter, null);
670 } catch (InterruptedException e) {
675 // Throw exception if one occurred.
676 adapter.throwOrWrapException();
681 public Session getSession() {
682 return processor.getSession();
686 public String toString() {
687 return "MergingGraphRequestProcessor[" + name + "]@" + System.identityHashCode(this) + " (based on " + processor + ")";
691 public <T> void asyncRequest(AsyncRead<T> request) {
693 asyncRequest(request, new ProcedureAdapter<T>() {
696 public void exception(Throwable t) {
697 LOGGER.error("asyncRequest(AsyncRead) failed", t);
705 public <T> void asyncRequest(AsyncRead<T> request, Procedure<T> procedure) {
706 asyncRequest(request, new NoneToAsyncProcedure<T>(procedure));
710 public <T> void asyncRequest(AsyncMultiRead<T> request) {
711 throw new UnsupportedOperationException("Not implemented.");
715 public <T> void asyncRequest(AsyncMultiRead<T> request,
716 MultiProcedure<T> procedure) {
717 throw new UnsupportedOperationException("Not implemented.");
721 public <T> T syncRequest(AsyncRead<T> request) {
723 final DataContainer<Throwable> throwable = new DataContainer<Throwable>(null);
724 final DataContainer<T> result = new DataContainer<T>();
726 syncRequest(request, new AsyncProcedure<T>() {
728 public void execute(AsyncReadGraph graph, T t) {
733 public void exception(AsyncReadGraph graph, Throwable t) {
739 Throwable t = throwable.get();
742 LOGGER.error("syncRequest(AsyncRead) failed", t);
743 throw new RuntimeException(t.getMessage());
751 public <T> T syncRequest(AsyncRead<T> request,
752 Procedure<T> procedure) {
753 throw new UnsupportedOperationException("Not implemented.");
757 public <T> Collection<T> syncRequest(AsyncMultiRead<T> request) {
759 final DataContainer<Throwable> throwable = new DataContainer<Throwable>(null);
760 final ArrayList<T> result = new ArrayList<T>();
762 syncRequest(request, new AsyncMultiProcedureAdapter<T>() {
765 public void execute(AsyncReadGraph graph, T t) {
766 synchronized(result) {
772 public void exception(AsyncReadGraph graph, Throwable t) {
778 Throwable t = throwable.get();
781 LOGGER.error("syncRequest(AsyncMultiRead) failed", t);
782 throw new RuntimeException(t.getMessage());
790 public <T> Collection<T> syncRequest(AsyncMultiRead<T> request,
791 MultiProcedure<T> procedure) {
792 throw new Error("Not implemented.");
796 public <T> T syncRequest(Read<T> request) {
798 final DataContainer<Throwable> throwable = new DataContainer<Throwable>(null);
799 final DataContainer<T> result = new DataContainer<T>();
802 syncRequest(request, new Procedure<T>() {
804 public void execute(T t) {
809 public void exception(Throwable t) {
815 Throwable t = throwable.get();
818 throw new Error(t.getMessage());
827 public <T> T syncRequest(Read<T> request,
828 final AsyncProcedure<T> procedure) {
830 final DataContainer<T> result = new DataContainer<T>(null);
831 final DataContainer<Throwable> throwable = new DataContainer<Throwable>(null);
833 // Queue the adapter up for execution.
834 synchronized (request) {
836 syncRequests.add(request);
837 asyncRequest(request, new AsyncProcedure<T>() {
839 public void execute(AsyncReadGraph graph, T t) {
840 synchronized(result) {
843 procedure.execute(graph, t);
847 public void exception(AsyncReadGraph graph, Throwable t) {
852 public String toString() {
853 return procedure.toString();
857 if(syncRequests.contains(request)) {
859 // System.out.println("waiting " + request);
861 } catch (InterruptedException e) {
867 Throwable t = throwable.get();
870 throw new RuntimeException("Unexpected exception in MergingGraphRequestProcessor.syncRequest(Read, AsyncProcedure)", t);
878 public <T> void asyncRequest(Read<T> request) {
880 asyncRequest(request, new ProcedureAdapter<T>() {
883 public void exception(Throwable t) {
884 LOGGER.error("asyncRequest(Read) failed", t);
892 public synchronized <T> void asyncRequest(Read<T> request,
893 AsyncProcedure<T> procedure) {
895 Pair<Object, Object> pair = Pair.make(request, procedure);
896 if (requestSet.contains(pair))
899 requestQueue.add(pair);
900 requestSet.add(pair);
902 if (!hasAlreadyRequest) {
904 hasAlreadyRequest = true;
912 public <T> T syncRequest(Read<T> request, Procedure<T> procedure) {
913 return syncRequest(request, new NoneToAsyncProcedure<T>(procedure));
917 public <T> Collection<T> syncRequest(final MultiRead<T> request) throws DatabaseException {
918 assert(request != null);
920 final ArrayList<T> result = new ArrayList<T>();
921 final DataContainer<Throwable> exception = new DataContainer<Throwable>();
923 syncRequest(request, new SyncMultiProcedureAdapter<T>() {
926 public void execute(ReadGraph graph, T t) {
927 synchronized(result) {
933 public void exception(ReadGraph graph, Throwable t) {
938 public String toString() {
939 return "syncRequest(MultiRead) -> " + request;
944 Throwable t = exception.get();
946 if(t instanceof DatabaseException) throw (DatabaseException)t;
947 else throw new DatabaseException("Unexpected exception in ReadGraph.syncRequest(Read)", t);
954 public <T> Collection<T> syncRequest(MultiRead<T> request, MultiProcedure<T> procedure) {
955 throw new UnsupportedOperationException("Not implemented");
959 public <T> void asyncRequest(Read<T> request, Procedure<T> procedure) {
960 asyncRequest(request, new NoneToAsyncProcedure<T>(procedure));
964 public <T> void asyncRequest(MultiRead<T> request) {
965 throw new UnsupportedOperationException("Not implemented");
969 public <T> void asyncRequest(MultiRead<T> request, MultiProcedure<T> procedure) {
970 throw new UnsupportedOperationException("Not implemented");
974 public void asyncRequest(Write r) {
975 asyncRequest(r, null);
979 public void asyncRequest(DelayedWrite r) {
980 asyncRequest(r, null);
984 public void asyncRequest(WriteOnly r) {
985 asyncRequest(r, null);
989 public <T> T getService(Class<T> api) {
990 return getSession().getService(api);
994 public <T> T peekService(Class<T> api) {
995 return getSession().peekService(api);
999 public boolean hasService(Class<?> api) {
1000 return getSession().hasService(api);
1004 public <T> void registerService(Class<T> api, T service) {
1005 getSession().registerService(api, service);
1009 // public <T> T syncRequest(Read<T> arg0, AsyncListener<T> arg1) {
1010 // throw new UnsupportedOperationException("Not implemented.");
1014 public <T> T syncRequest(Read<T> arg0, SyncListener<T> arg1) {
1015 throw new UnsupportedOperationException("Not implemented.");
1019 public <T> T syncRequest(Read<T> arg0, Listener<T> arg1) {
1020 throw new UnsupportedOperationException("Not implemented.");
1024 public <T> T syncRequest(Read<T> arg0, SyncProcedure<T> arg1) {
1025 throw new UnsupportedOperationException("Not implemented.");
1029 public <T> T syncRequest(AsyncRead<T> arg0, AsyncListener<T> arg1) {
1030 throw new UnsupportedOperationException("Not implemented.");
1034 public <T> T syncRequest(AsyncRead<T> arg0, SyncListener<T> arg1) {
1035 throw new UnsupportedOperationException("Not implemented.");
1040 public <T> T syncRequest(AsyncRead<T> arg0, Listener<T> arg1) {
1041 throw new UnsupportedOperationException("Not implemented.");
1046 public <T> T syncRequest(AsyncRead<T> arg0, SyncProcedure<T> arg1) {
1047 throw new UnsupportedOperationException("Not implemented.");
1052 public <T> void asyncRequest(Read<T> arg0, AsyncListener<T> arg1) {
1053 throw new UnsupportedOperationException("Not implemented.");
1058 public <T> void asyncRequest(Read<T> arg0, SyncListener<T> arg1) {
1059 throw new UnsupportedOperationException("Not implemented.");
1064 public <T> void asyncRequest(Read<T> arg0, Listener<T> arg1) {
1065 throw new UnsupportedOperationException("Not implemented.");
1070 public <T> void asyncRequest(Read<T> arg0, SyncProcedure<T> arg1) {
1071 throw new UnsupportedOperationException("Not implemented.");
1076 public <T> void asyncRequest(AsyncRead<T> arg0, AsyncListener<T> arg1) {
1077 throw new UnsupportedOperationException("Not implemented.");
1082 public <T> void asyncRequest(AsyncRead<T> arg0, SyncListener<T> arg1) {
1083 throw new UnsupportedOperationException("Not implemented.");
1088 public <T> void asyncRequest(AsyncRead<T> arg0, Listener<T> arg1) {
1089 throw new UnsupportedOperationException("Not implemented.");
1094 public <T> void asyncRequest(AsyncRead<T> arg0, SyncProcedure<T> arg1) {
1095 throw new UnsupportedOperationException("Not implemented.");
1100 public <T> Collection<T> syncRequest(MultiRead<T> arg0, SyncMultiListener<T> arg1) {
1101 throw new UnsupportedOperationException("Not implemented.");
1106 public <T> Collection<T> syncRequest(MultiRead<T> arg0, MultiListener<T> arg1) {
1107 throw new UnsupportedOperationException("Not implemented.");
1112 public <T> Collection<T> syncRequest(MultiRead<T> arg0, SyncMultiProcedure<T> arg1) {
1113 throw new UnsupportedOperationException("Not implemented.");
1118 public <T> Collection<T> syncRequest(AsyncMultiRead<T> arg0,
1119 AsyncMultiListener<T> arg1) {
1120 throw new UnsupportedOperationException("Not implemented.");
1125 public <T> Collection<T> syncRequest(AsyncMultiRead<T> arg0, SyncMultiListener<T> arg1) {
1126 throw new UnsupportedOperationException("Not implemented.");
1131 public <T> Collection<T> syncRequest(AsyncMultiRead<T> arg0,
1132 MultiListener<T> arg1) {
1133 throw new UnsupportedOperationException("Not implemented.");
1138 public <T> Collection<T> syncRequest(AsyncMultiRead<T> arg0, SyncMultiProcedure<T> arg1) {
1139 throw new UnsupportedOperationException("Not implemented.");
1144 public <T> void asyncRequest(MultiRead<T> arg0, SyncMultiListener<T> arg1) {
1145 throw new UnsupportedOperationException("Not implemented.");
1150 public <T> void asyncRequest(MultiRead<T> arg0, MultiListener<T> arg1) {
1151 throw new UnsupportedOperationException("Not implemented.");
1156 public <T> void asyncRequest(MultiRead<T> arg0, SyncMultiProcedure<T> arg1) {
1157 throw new UnsupportedOperationException("Not implemented.");
1162 public <T> void asyncRequest(AsyncMultiRead<T> arg0,
1163 AsyncMultiListener<T> arg1) {
1164 throw new UnsupportedOperationException("Not implemented.");
1168 public <T> void asyncRequest(AsyncMultiRead<T> arg0, SyncMultiListener<T> arg1) {
1169 throw new UnsupportedOperationException("Not implemented.");
1174 public <T> void asyncRequest(AsyncMultiRead<T> arg0,
1175 MultiListener<T> arg1) {
1176 throw new UnsupportedOperationException("Not implemented.");
1181 public <T> void asyncRequest(AsyncMultiRead<T> arg0, SyncMultiProcedure<T> arg1) {
1182 throw new UnsupportedOperationException("Not implemented.");
1186 public <T> void asyncRequest(ExternalRead<T> request, Procedure<T> procedure) {
1187 throw new UnsupportedOperationException("Not implemented.");
1191 public <T> T syncRequest(ExternalRead<T> request) {
1192 throw new UnsupportedOperationException("Not implemented.");
1196 public <T> T syncRequest(ExternalRead<T> request, Listener<T> procedure) {
1197 throw new UnsupportedOperationException("Not implemented.");
1201 public <T> T syncRequest(ExternalRead<T> request, Procedure<T> procedure) {
1202 throw new UnsupportedOperationException("Not implemented.");
1206 public <T> void asyncRequest(ExternalRead<T> request) {
1207 throw new UnsupportedOperationException("Not implemented.");
1211 public <T> void asyncRequest(ExternalRead<T> request, Listener<T> procedure) {
1212 throw new UnsupportedOperationException("Not implemented.");
1216 public void syncRequest(DelayedWrite request) throws DatabaseException {
1217 throw new UnsupportedOperationException("Not implemented.");
1221 public <T> T syncRequest(WriteResult<T> request) throws DatabaseException {
1222 throw new UnsupportedOperationException();
1226 public <T> T syncRequest(DelayedWriteResult<T> request)
1227 throws DatabaseException {
1228 throw new UnsupportedOperationException();
1232 public <T> T syncRequest(WriteOnlyResult<T> r) throws DatabaseException {
1233 throw new UnsupportedOperationException();
1237 public <T> void asyncRequest(WriteResult<T> r, Procedure<T> procedure) {
1238 throw new UnsupportedOperationException();
1242 public <T> void asyncRequest(DelayedWriteResult<T> r, Procedure<T> procedure) {
1243 throw new UnsupportedOperationException();
1247 public <T> void asyncRequest(WriteOnlyResult<T> r, Procedure<T> procedure) {
1248 throw new UnsupportedOperationException();
1252 public Resource getRootLibrary() {
1253 return processor.getRootLibrary();
1257 public <T> void async(ReadInterface<T> r, Procedure<T> procedure) {
1258 throw new UnsupportedOperationException();
1262 public <T> void async(ReadInterface<T> r, AsyncProcedure<T> procedure) {
1263 throw new UnsupportedOperationException();
1267 public <T> void async(ReadInterface<T> r, SyncProcedure<T> procedure) {
1268 throw new UnsupportedOperationException();
1272 public <T> void async(ReadInterface<T> r, Listener<T> procedure) {
1273 throw new UnsupportedOperationException();
1277 public <T> void async(ReadInterface<T> r, AsyncListener<T> procedure) {
1278 throw new UnsupportedOperationException();
1282 public <T> void async(ReadInterface<T> r, SyncListener<T> procedure) {
1283 throw new UnsupportedOperationException();
1287 public <T> T sync(ReadInterface<T> r) throws DatabaseException {
1288 throw new UnsupportedOperationException();
1292 public <T> T sync(WriteInterface<T> r) throws DatabaseException {
1293 throw new UnsupportedOperationException();
1297 public <T> void async(WriteInterface<T> r, Procedure<T> procedure) {
1298 throw new UnsupportedOperationException();
1302 public <T> void async(WriteInterface<T> r) {
1303 throw new UnsupportedOperationException();
1307 public Object getModificationCounter() {
1308 throw new UnsupportedOperationException();
1313 return processor.l0();