]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db/src/org/simantics/db/AsyncRequestProcessorSpecific.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db / src / org / simantics / db / AsyncRequestProcessorSpecific.java
diff --git a/bundles/org.simantics.db/src/org/simantics/db/AsyncRequestProcessorSpecific.java b/bundles/org.simantics.db/src/org/simantics/db/AsyncRequestProcessorSpecific.java
new file mode 100644 (file)
index 0000000..b0e57b3
--- /dev/null
@@ -0,0 +1,526 @@
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.db;\r
+\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.procedure.AsyncListener;\r
+import org.simantics.db.procedure.AsyncMultiListener;\r
+import org.simantics.db.procedure.AsyncMultiProcedure;\r
+import org.simantics.db.procedure.AsyncProcedure;\r
+import org.simantics.db.procedure.Listener;\r
+import org.simantics.db.procedure.MultiListener;\r
+import org.simantics.db.procedure.MultiProcedure;\r
+import org.simantics.db.procedure.Procedure;\r
+import org.simantics.db.procedure.SyncListener;\r
+import org.simantics.db.procedure.SyncMultiListener;\r
+import org.simantics.db.procedure.SyncMultiProcedure;\r
+import org.simantics.db.procedure.SyncProcedure;\r
+import org.simantics.db.request.AsyncMultiRead;\r
+import org.simantics.db.request.AsyncRead;\r
+import org.simantics.db.request.DelayedWrite;\r
+import org.simantics.db.request.DelayedWriteResult;\r
+import org.simantics.db.request.ExternalRead;\r
+import org.simantics.db.request.MultiRead;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.db.request.Write;\r
+import org.simantics.db.request.WriteOnly;\r
+import org.simantics.db.request.WriteOnlyResult;\r
+import org.simantics.db.request.WriteResult;\r
+import org.simantics.utils.datastructures.Callback;\r
+\r
+/**\r
+ * \r
+ * For initiating requests in asynchronous manner. The possible requests are\r
+ * <ul>\r
+ * <li>{@link Read} for computing a single result synchronously\r
+ * <li>{@link AsyncRead} for computing a single result asynchronously\r
+ * <li>{@link MultiRead} for computing a collection of results synchronously\r
+ * <li>{@link AsyncMultiRead} for computing a collection of results\r
+ * asynchronously\r
+ * <li>{@link Write} for reading and writing synchronously\r
+ * <li>{@link WriteOnly} for writing synchronously\r
+ * </ul>\r
+ * <p>\r
+ * The standard AsyncRequestProcessors are\r
+ * <ul>\r
+ * <li>{@link AsyncReadGraph} for performing requests during other requests\r
+ * <li>{@link Session} for initiating a transactions for performing requests\r
+ * <li>{@link MergingGraphRequestProcessor} for merging several requests in a\r
+ * single transaction\r
+ * </ul>\r
+ * \r
+ * Database services (see e.g. {@link Session}) are available from implemented\r
+ * {@link ServiceLocator}. For a synchronous counterpart with the same\r
+ * functionality as AsyncRequestProcessor see {@link RequestProcessor}\r
+ * \r
+ * @version 0.7\r
+ * @author Antti Villberg\r
+ * @see Read\r
+ * @see AsyncRead\r
+ * @see MultiRead\r
+ * @see AsyncMultiRead\r
+ * @see Write\r
+ * @see WriteOnly\r
+ * @see AsyncReadGraph\r
+ * @see Session\r
+ * @see MergingGraphRequestProcessor\r
+ * @see RequestProcessor\r
+ */\r
+public interface AsyncRequestProcessorSpecific extends ServiceLocator {\r
+\r
+    /**\r
+     * Provides access to a set of standard resources defined in Layer0. The\r
+     * existence of {@link Builtins} is guaranteed at {@link Session} creation\r
+     * time hence the method does not throw. It is also assumed that the\r
+     * identify of the standard resources cannot change during sessions. To work\r
+     * this requires that Builtins.class has been registered with this\r
+     * ServiceLocator. Therefore this is merely a shorthand for\r
+     * <code>ServiceLocator.getService(Builtins.class)</code>.\r
+     * \r
+     * @deprecated in favor of org.simantics.layer0.Layer0. Will be removed in Simantics 1.2\r
+     * \r
+     * @return the <code>Builtins</code> instance associated with this session.\r
+     */\r
+//    @Deprecated\r
+//    Builtins getBuiltins();\r
+\r
+    /**\r
+     * Asynchronously determines the result of the given {@link Read} and\r
+     * registers the given {@link Read} as a dependency of the ongoing request\r
+     * if any. This is usually invoked for the side-effects of the given\r
+     * {@link Read} but can also be used for e.g. dependency registering or\r
+     * cache priming. All exceptions from request processing will be lost.\r
+     * \r
+     * @param request an instance of {@link Read}.\r
+     */\r
+    <T> void asyncRequest(Read<T> request);\r
+\r
+    /**\r
+     * Asynchronously registers the given {@link AsyncListener} (as identified\r
+     * by {@link Object#equals(Object)}) to track changes in the result\r
+     * determined from the given {@link Read}. Registers the given {@link Read}\r
+     * as a dependency of the ongoing request if any. Exceptions due to the\r
+     * determination of the result of the given {@link Read} will be transferred\r
+     * to the given {@link AsyncListener}.\r
+     * \r
+     * @param request an instance of {@link Read}.\r
+     * @param procedure an instance of {@link AsyncListener}.\r
+     */\r
+    <T> void asyncRequest(Read<T> request, AsyncListener<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously registers the given {@link SyncListener} (as identified by\r
+     * {@link Object#equals(Object)}) to track changes in the result determined\r
+     * from the given {@link Read}. Registers the given {@link Read} as a\r
+     * dependency of the ongoing request if any. Exceptions due to the\r
+     * determination of the result of the given {@link Read} will be transferred\r
+     * to the given {@link SyncListener}\r
+     * \r
+     * @param request an instance of {@link Read}.\r
+     * @param procedure an instance of {@link SyncListener}.\r
+     */\r
+    <T> void asyncRequest(Read<T> request, SyncListener<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously registers the given {@link Listener} (as identified by\r
+     * {@link Object#equals(Object)}) to track changes in the result determined\r
+     * from the given {@link Read}. Registers the given {@link Read} as a\r
+     * dependency of the ongoing request if any. Exceptions due to the\r
+     * determination of the result of the given {@link Read} will be transferred\r
+     * to the given {@link Listener}\r
+     * \r
+     * @param request an instance of {@link Read}.\r
+     * @param procedure an instance of {@link Listener}.\r
+     */\r
+    <T> void asyncRequest(Read<T> request, Listener<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously supplies the result determined from the given {@link Read}\r
+     * to the given {@link AsyncProcedure}. Registers the given {@link Read} as\r
+     * a dependency of the ongoing request if any. Exceptions due to the\r
+     * determination of the result of the given {@link Read} will be transferred\r
+     * to the given {@link AsyncProcedure}\r
+     * \r
+     * @param request an instance of {@link Read}.\r
+     * @param procedure an instance of {@link AsyncProcedure}.\r
+     */\r
+    <T> void asyncRequest(Read<T> request, AsyncProcedure<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously supplies the result determined from the given {@link Read}\r
+     * to the given {@link SyncProcedure}. Registers the given {@link Read} as a\r
+     * dependency of the ongoing request if any. Exceptions due to the\r
+     * determination of the result of the given {@link Read} will be transferred\r
+     * to the given {@link SyncProcedure}\r
+     * \r
+     * @param request an instance of {@link Read}.\r
+     * @param procedure an instance of {@link SyncProcedure}.\r
+     */\r
+    <T> void asyncRequest(Read<T> request, SyncProcedure<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously supplies the result determined from the given {@link Read}\r
+     * to the given {@link Procedure}. Registers the given {@link Read} as a\r
+     * dependency of the ongoing request if any. Exceptions due to the\r
+     * determination of the result of the given {@link Read} will be transferred\r
+     * to the given {@link Procedure}\r
+     * \r
+     * @param request an instance of {@link Read}.\r
+     * @param procedure an instance of {@link Procedure}.\r
+     */\r
+    <T> void asyncRequest(Read<T> request, Procedure<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously determines the result of the given {@link AsyncRead} and\r
+     * registers the given {@link AsyncRead} as a dependency of the ongoing\r
+     * request if any. This is usually invoked for the side-effects of the given\r
+     * {@link AsyncRead} but can also be used for e.g. dependency registering or\r
+     * cache priming. All exceptions from request processing will be lost.\r
+     * \r
+     * @param request an instance of {@link AsyncRead}.\r
+     */\r
+    <T> void asyncRequest(AsyncRead<T> request);\r
+\r
+    /**\r
+     * Asynchronously registers the given {@link AsyncListener} (as identified\r
+     * by {@link Object#equals(Object)}) to track changes in the result\r
+     * determined from the given {@link AsyncRead}. Registers the given\r
+     * {@link AsyncRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link AsyncRead} will be transferred to the given {@link AsyncListener}.\r
+     * \r
+     * @param request an instance of {@link AsyncRead}.\r
+     * @param procedure an instance of {@link AsyncListener}.\r
+     */\r
+    <T> void asyncRequest(AsyncRead<T> request, AsyncListener<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously registers the given {@link SyncListener} (as identified by\r
+     * {@link Object#equals(Object)}) to track changes in the result determined\r
+     * from the given {@link AsyncRead}. Registers the given {@link AsyncRead}\r
+     * as a dependency of the ongoing request if any. Exceptions due to the\r
+     * determination of the result of the given {@link AsyncRead} will be\r
+     * transferred to the given {@link SyncListener}\r
+     * \r
+     * @param request an instance of {@link AsyncRead}.\r
+     * @param procedure an instance of {@link SyncListener}.\r
+     */\r
+    <T> void asyncRequest(AsyncRead<T> request, SyncListener<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously registers the given {@link Listener} (as identified by\r
+     * {@link Object#equals(Object)}) to track changes in the result determined\r
+     * from the given {@link AsyncRead}. Registers the given {@link AsyncRead}\r
+     * as a dependency of the ongoing request if any. Exceptions due to the\r
+     * determination of the result of the given {@link AsyncRead} will be\r
+     * transferred to the given {@link Listener}\r
+     * \r
+     * @param request an instance of {@link AsyncRead}.\r
+     * @param procedure an instance of {@link Listener}.\r
+     */\r
+    <T> void asyncRequest(AsyncRead<T> request, Listener<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously supplies the result determined from the given\r
+     * {@link AsyncRead} to the given {@link AsyncProcedure}. Registers the\r
+     * given {@link AsyncRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link AsyncRead} will be transferred to the given {@link AsyncProcedure}\r
+     * \r
+     * @param request an instance of {@link AsyncRead}.\r
+     * @param procedure an instance of {@link AsyncProcedure}.\r
+     */\r
+    <T> void asyncRequest(AsyncRead<T> request, AsyncProcedure<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously supplies the result determined from the given\r
+     * {@link AsyncRead} to the given {@link SyncProcedure}. Registers the given\r
+     * {@link AsyncRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link AsyncRead} will be transferred to the given {@link SyncProcedure}\r
+     * \r
+     * @param request an instance of {@link AsyncRead}.\r
+     * @param procedure an instance of {@link SyncProcedure}.\r
+     */\r
+    <T> void asyncRequest(AsyncRead<T> request, SyncProcedure<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously supplies the result determined from the given\r
+     * {@link AsyncRead} to the given {@link Procedure}. Registers the given\r
+     * {@link AsyncRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link AsyncRead} will be transferred to the given {@link Procedure}\r
+     * \r
+     * @param request an instance of {@link AsyncRead}.\r
+     * @param procedure an instance of {@link Procedure}.\r
+     */\r
+    <T> void asyncRequest(AsyncRead<T> request, Procedure<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously determines the result of the given {@link MultiRead} and\r
+     * registers the given {@link MultiRead} as a dependency of the ongoing\r
+     * request if any. This is usually invoked for the side-effects of the given\r
+     * {@link MultiRead} but can also be used for e.g. dependency registering or\r
+     * cache priming. All exceptions from request processing will be lost.\r
+     * \r
+     * @param request an instance of {@link MultiRead}.\r
+     */\r
+    <T> void asyncRequest(MultiRead<T> request);\r
+\r
+    /**\r
+     * Asynchronously registers the given {@link AsyncMultiListener} (as\r
+     * identified by {@link Object#equals(Object)}) to track changes in the\r
+     * result determined from the given {@link MultiRead}. Registers the given\r
+     * {@link MultiRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link MultiRead} will be transferred to the given\r
+     * {@link AsyncMultiListener}.\r
+     * \r
+     * @param request an instance of {@link MultiRead}.\r
+     * @param procedure an instance of {@link AsyncMultiListener}.\r
+     */\r
+    <T> void asyncRequest(MultiRead<T> request, AsyncMultiListener<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously registers the given {@link SyncMultiListener} (as\r
+     * identified by {@link Object#equals(Object)}) to track changes in the\r
+     * result determined from the given {@link MultiRead}. Registers the given\r
+     * {@link MultiRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link MultiRead} will be transferred to the given\r
+     * {@link SyncMultiListener}\r
+     * \r
+     * @param request an instance of {@link MultiRead}.\r
+     * @param procedure an instance of {@link SyncMultiListener}.\r
+     */\r
+    <T> void asyncRequest(MultiRead<T> request, SyncMultiListener<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously registers the given {@link MultiListener} (as identified\r
+     * by {@link Object#equals(Object)}) to track changes in the result\r
+     * determined from the given {@link MultiRead}. Registers the given\r
+     * {@link MultiRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link MultiRead} will be transferred to the given {@link MultiListener}\r
+     * \r
+     * @param request an instance of {@link MultiRead}.\r
+     * @param procedure an instance of {@link MultiListener}.\r
+     */\r
+    <T> void asyncRequest(MultiRead<T> request, MultiListener<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously supplies the result determined from the given\r
+     * {@link MultiRead} to the given {@link AsyncMultiProcedure}. Registers the\r
+     * given {@link MultiRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link MultiRead} will be transferred to the given\r
+     * {@link AsyncMultiProcedure}\r
+     * \r
+     * @param request an instance of {@link MultiRead}.\r
+     * @param procedure an instance of {@link AsyncMultiProcedure}.\r
+     */\r
+    <T> void asyncRequest(MultiRead<T> request, AsyncMultiProcedure<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously supplies the result determined from the given\r
+     * {@link MultiRead} to the given {@link SyncMultiProcedure}. Registers the\r
+     * given {@link MultiRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link MultiRead} will be transferred to the given\r
+     * {@link SyncMultiProcedure}\r
+     * \r
+     * @param request an instance of {@link MultiRead}.\r
+     * @param procedure an instance of {@link SyncMultiProcedure}.\r
+     */\r
+    <T> void asyncRequest(MultiRead<T> request, SyncMultiProcedure<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously supplies the result determined from the given\r
+     * {@link MultiRead} to the given {@link MultiProcedure}. Registers the\r
+     * given {@link MultiRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link MultiRead} will be transferred to the given {@link MultiProcedure}\r
+     * \r
+     * @param request an instance of {@link MultiRead}.\r
+     * @param procedure an instance of {@link MultiProcedure}.\r
+     */\r
+    <T> void asyncRequest(MultiRead<T> request, MultiProcedure<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously determines the result of the given {@link AsyncMultiRead}\r
+     * and registers the given {@link AsyncMultiRead} as a dependency of the\r
+     * ongoing request if any. This is usually invoked for the side-effects of\r
+     * the given {@link AsyncMultiRead} but can also be used for e.g. dependency\r
+     * registering or cache priming. All exceptions from request processing will\r
+     * be lost.\r
+     * \r
+     * @param request an instance of {@link AsyncMultiRead}.\r
+     */\r
+    <T> void asyncRequest(AsyncMultiRead<T> request);\r
+\r
+    /**\r
+     * Asynchronously registers the given {@link AsyncMultiListener} (as\r
+     * identified by {@link Object#equals(Object)}) to track changes in the\r
+     * result determined from the given {@link AsyncMultiRead}. Registers the\r
+     * given {@link AsyncMultiRead} as a dependency of the ongoing request if\r
+     * any. Exceptions due to the determination of the result of the given\r
+     * {@link AsyncMultiRead} will be transferred to the given\r
+     * {@link AsyncMultiListener}.\r
+     * \r
+     * @param request an instance of {@link AsyncMultiRead}.\r
+     * @param procedure an instance of {@link AsyncMultiListener}.\r
+     */\r
+    <T> void asyncRequest(AsyncMultiRead<T> request, AsyncMultiListener<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously registers the given {@link SyncMultiListener} (as\r
+     * identified by {@link Object#equals(Object)}) to track changes in the\r
+     * result determined from the given {@link AsyncMultiRead}. Registers the\r
+     * given {@link AsyncMultiRead} as a dependency of the ongoing request if\r
+     * any. Exceptions due to the determination of the result of the given\r
+     * {@link AsyncMultiRead} will be transferred to the given\r
+     * {@link SyncMultiListener}\r
+     * \r
+     * @param request an instance of {@link AsyncMultiRead}.\r
+     * @param procedure an instance of {@link SyncMultiListener}.\r
+     */\r
+    <T> void asyncRequest(AsyncMultiRead<T> request, SyncMultiListener<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously registers the given {@link MultiListener} (as identified\r
+     * by {@link Object#equals(Object)}) to track changes in the result\r
+     * determined from the given {@link AsyncMultiRead}. Registers the given\r
+     * {@link AsyncMultiRead} as a dependency of the ongoing request if any.\r
+     * Exceptions due to the determination of the result of the given\r
+     * {@link AsyncMultiRead} will be transferred to the given\r
+     * {@link MultiListener}\r
+     * \r
+     * @param request an instance of {@link AsyncMultiRead}.\r
+     * @param procedure an instance of {@link MultiListener}.\r
+     */\r
+    <T> void asyncRequest(AsyncMultiRead<T> request, MultiListener<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously supplies the result determined from the given\r
+     * {@link AsyncMultiRead} to the given {@link AsyncMultiProcedure}.\r
+     * Registers the given {@link AsyncMultiRead} as a dependency of the ongoing\r
+     * request if any. Exceptions due to the determination of the result of the\r
+     * given {@link AsyncMultiRead} will be transferred to the given\r
+     * {@link AsyncMultiProcedure}\r
+     * \r
+     * @param request an instance of {@link AsyncMultiRead}.\r
+     * @param procedure an instance of {@link AsyncMultiProcedure}.\r
+     */\r
+    <T> void asyncRequest(AsyncMultiRead<T> request, AsyncMultiProcedure<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously supplies the result determined from the given\r
+     * {@link AsyncMultiRead} to the given {@link SyncMultiProcedure}. Registers\r
+     * the given {@link AsyncMultiRead} as a dependency of the ongoing request\r
+     * if any. Exceptions due to the determination of the result of the given\r
+     * {@link AsyncMultiRead} will be transferred to the given\r
+     * {@link SyncMultiProcedure}\r
+     * \r
+     * @param request an instance of {@link AsyncMultiRead}.\r
+     * @param procedure an instance of {@link SyncMultiProcedure}.\r
+     */\r
+    <T> void asyncRequest(AsyncMultiRead<T> request, SyncMultiProcedure<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously supplies the result determined from the given\r
+     * {@link AsyncMultiRead} to the given {@link MultiProcedure}. Registers the\r
+     * given {@link AsyncMultiRead} as a dependency of the ongoing request if\r
+     * any. Exceptions due to the determination of the result of the given\r
+     * {@link AsyncMultiRead} will be transferred to the given\r
+     * {@link MultiProcedure}\r
+     * \r
+     * @param request an instance of {@link AsyncMultiRead}.\r
+     * @param procedure an instance of {@link MultiProcedure}.\r
+     */\r
+    <T> void asyncRequest(AsyncMultiRead<T> request, MultiProcedure<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously determines the result of the given {@link AsyncMultiRead}\r
+     * and registers the given {@link AsyncMultiRead} as a dependency of the\r
+     * ongoing request if any. This is usually invoked for the side-effects of\r
+     * the given {@link AsyncMultiRead} but can also be used for e.g. dependency\r
+     * registering or cache priming. All exceptions from request processing will\r
+     * be lost.\r
+     * \r
+     * @param request an instance of {@link AsyncMultiRead}.\r
+     */\r
+    <T> void asyncRequest(ExternalRead<T> request);\r
+    <T> void asyncRequest(ExternalRead<T> request, Listener<T> procedure);\r
+    <T> void asyncRequest(ExternalRead<T> request, Procedure<T> procedure);\r
+    \r
+    /**\r
+     * Asynchronously performs the given {@link Write}. The outcome of the\r
+     * request will be lost.\r
+     * \r
+     * @param request an instance of {@link Write}.\r
+     */\r
+    void asyncRequest(Write request);\r
+\r
+    /**\r
+     * Asynchronously performs the given {@link Write}. The outcome of the\r
+     * request will be reported to given {@link Callback} in the form of a\r
+     * DatabaseException raised during request processing or null upon success.\r
+     * \r
+     * @param request an instance of {@link Write}.\r
+     * @param request an instance of {@link Callback}.\r
+     */\r
+    void asyncRequest(Write request, Callback<DatabaseException> callback);\r
+    \r
+    <T> void asyncRequest(WriteResult<T> r, Procedure<T> procedure);\r
+    \r
+\r
+    /**\r
+     * Asynchronously performs the given {@link WriteOnly}. The outcome of the\r
+     * request will be lost.\r
+     * \r
+     * @param request an instance of {@link Write}.\r
+     */\r
+    void asyncRequest(DelayedWrite request);\r
+\r
+    /**\r
+     * Asynchronously performs the given {@link WriteOnly}. The outcome of the\r
+     * request will be reported to given {@link Callback} in the form of a\r
+     * DatabaseException raised during request processing or null upon success.\r
+     * \r
+     * @param request an instance of {@link WriteOnly}.\r
+     * @param request an instance of {@link Callback}.\r
+     */\r
+    void asyncRequest(DelayedWrite request, Callback<DatabaseException> callback);\r
+\r
+    <T> void asyncRequest(DelayedWriteResult<T> r, Procedure<T> procedure);\r
+\r
+    /**\r
+     * Asynchronously performs the given {@link WriteOnly}. The outcome of the\r
+     * request will be lost.\r
+     * \r
+     * @param request an instance of {@link Write}.\r
+     */\r
+    void asyncRequest(WriteOnly r);\r
+\r
+    /**\r
+     * Asynchronously performs the given {@link WriteOnly}. The outcome of the\r
+     * request will be reported to given {@link Callback} in the form of a\r
+     * DatabaseException raised during request processing or null upon success.\r
+     * \r
+     * @param request an instance of {@link WriteOnly}.\r
+     * @param request an instance of {@link Callback}.\r
+     */\r
+    void asyncRequest(WriteOnly r, Callback<DatabaseException> callback);\r
+    \r
+    <T> void asyncRequest(WriteOnlyResult<T> r, Procedure<T> procedure);\r
+    \r
+}\r