X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db%2Fsrc%2Forg%2Fsimantics%2Fdb%2FRequestProcessorSpecific.java;h=b121c0829be16e422439bf69425eea38c6a4f1b6;hb=b2bb3ff110b5bf929b6d676f0122a15a43358440;hp=523d410137a1341bec5e5b3e23f554a338b5c019;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db/src/org/simantics/db/RequestProcessorSpecific.java b/bundles/org.simantics.db/src/org/simantics/db/RequestProcessorSpecific.java index 523d41013..b121c0829 100644 --- a/bundles/org.simantics.db/src/org/simantics/db/RequestProcessorSpecific.java +++ b/bundles/org.simantics.db/src/org/simantics/db/RequestProcessorSpecific.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * Copyright (c) 2007, 2018 Association for Decentralized Information Management * in Industry THTH ry. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -12,6 +12,7 @@ package org.simantics.db; import java.util.Collection; +import java.util.function.Consumer; import org.simantics.db.exception.DatabaseException; import org.simantics.db.procedure.AsyncListener; @@ -82,7 +83,7 @@ import org.simantics.db.request.WriteResult; * @see MergingGraphRequestProcessor * @see AsyncRequestProcessor */ -public interface RequestProcessorSpecific extends AsyncRequestProcessor { +public interface RequestProcessorSpecific { /** * Synchronously determines and returns the result of the given {@link Read} @@ -288,7 +289,7 @@ public interface RequestProcessorSpecific extends AsyncRequestProcessor { * @param request an instance of {@link MultiRead}. * @param procedure an instance of {@link AsyncMultiListener}. */ - Collection syncRequest(MultiRead request, AsyncMultiListener procedure) throws DatabaseException; + // Collection syncRequest(MultiRead request, AsyncMultiListener procedure) throws DatabaseException; /** * Synchronously registers the given {@link SyncMultiListener} (as @@ -328,7 +329,7 @@ public interface RequestProcessorSpecific extends AsyncRequestProcessor { * @param request an instance of {@link MultiRead}. * @param procedure an instance of {@link AsyncMultiProcedure}. */ - Collection syncRequest(MultiRead request, AsyncMultiProcedure procedure) throws DatabaseException; + // Collection syncRequest(MultiRead request, AsyncMultiProcedure procedure) throws DatabaseException; /** * Synchronously supplies the result determined from the given @@ -496,5 +497,66 @@ public interface RequestProcessorSpecific extends AsyncRequestProcessor { * @param request an instance of {@link Write}. */ T syncRequest(WriteOnlyResult r) throws DatabaseException; - + + /** + * Asynchronously performs the given {@link Write}. The outcome of the + * request will be lost. + * + * @param request an instance of {@link Write}. + */ + void asyncRequest(Write request); + + /** + * Asynchronously performs the given {@link Write}. The outcome of the + * request will be reported to given {@link Consumer} in the form of a + * DatabaseException raised during request processing or null upon success. + * + * @param request an instance of {@link Write}. + * @param request an instance of {@link Consumer}. + */ + void asyncRequest(Write request, Consumer callback); + + void asyncRequest(WriteResult r, Procedure procedure); + + + /** + * Asynchronously performs the given {@link WriteOnly}. The outcome of the + * request will be lost. + * + * @param request an instance of {@link Write}. + */ + void asyncRequest(DelayedWrite request); + + /** + * Asynchronously performs the given {@link WriteOnly}. The outcome of the + * request will be reported to given {@link Consumer} in the form of a + * DatabaseException raised during request processing or null upon success. + * + * @param request an instance of {@link WriteOnly}. + * @param request an instance of {@link Consumer}. + */ + void asyncRequest(DelayedWrite request, Consumer callback); + + void asyncRequest(DelayedWriteResult r, Procedure procedure); + + /** + * Asynchronously performs the given {@link WriteOnly}. The outcome of the + * request will be lost. + * + * @param request an instance of {@link Write}. + */ + void asyncRequest(WriteOnly r); + + /** + * Asynchronously performs the given {@link WriteOnly}. The outcome of the + * request will be reported to given {@link Consumer} in the form of a + * DatabaseException raised during request processing or null upon success. + * + * @param request an instance of {@link WriteOnly}. + * @param request an instance of {@link Consumer}. + */ + void asyncRequest(WriteOnly r, Consumer callback); + + void asyncRequest(WriteOnlyResult r, Procedure procedure); + }