ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [31/51] [abbrv] incubator-ignite git commit: Applied patch for AsyncSupportAdapter from Pavel T.. Now it is possible to get future for the last async operation without clearing it.
Date Thu, 12 Mar 2015 05:35:56 GMT
Applied patch for AsyncSupportAdapter from Pavel T..
Now it is possible to get future for the last async operation without clearing it.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/14dcb40e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/14dcb40e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/14dcb40e

Branch: refs/heads/ignite-45
Commit: 14dcb40e91842b163467a0fa7cc6172ee38ec4d8
Parents: 94327f9
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Wed Mar 11 16:46:39 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Mar 11 16:46:39 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/AsyncSupportAdapter.java  | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/14dcb40e/modules/core/src/main/java/org/apache/ignite/internal/AsyncSupportAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/AsyncSupportAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/AsyncSupportAdapter.java
index 8fed54f..e02cb89 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/AsyncSupportAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/AsyncSupportAdapter.java
@@ -69,6 +69,18 @@ public class AsyncSupportAdapter<T extends IgniteAsyncSupport> implements
Ignite
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Override public <R> IgniteFuture<R> future() {
+        return future(true);
+    }
+
+    /**
+     * Gets and optionally resets future for previous asynchronous operation.
+     *
+     * @param reset Specifies whether to reset future.
+     *
+     * @return Future for previous asynchronous operation.
+     */
+    @SuppressWarnings("unchecked")
+    public <R> IgniteFuture<R> future(boolean reset) {
         if (curFut == null)
             throw new IllegalStateException("Asynchronous mode is disabled.");
 
@@ -77,7 +89,8 @@ public class AsyncSupportAdapter<T extends IgniteAsyncSupport> implements
Ignite
         if (fut == null)
             throw new IllegalStateException("Asynchronous operation not started.");
 
-        curFut.set(null);
+        if (reset)
+            curFut.set(null);
 
         return (IgniteFuture<R>)fut;
     }


Mime
View raw message