ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [10/32] incubator-ignite git commit: #ignite-738: Fix async supported.
Date Mon, 20 Apr 2015 02:09:50 GMT
#ignite-738: Fix async supported.


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

Branch: refs/heads/ignite-737
Commit: 483b620856d36d482b8c6bbe59af29cd38c79666
Parents: a4143aa
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Wed Apr 15 12:42:21 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Wed Apr 15 12:42:21 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/IgniteCacheProxy.java      | 28 +++++++++++++-------
 1 file changed, 19 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/483b6208/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 2cda18a..2f2d70c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -41,8 +41,7 @@ import java.util.concurrent.locks.*;
 /**
  * Cache proxy.
  */
-public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K,
V>>
-    implements IgniteCache<K, V>, Externalizable {
+public class IgniteCacheProxy<K, V> implements IgniteCache<K, V>, Externalizable
{
     /** */
     private static final long serialVersionUID = 0L;
 
@@ -75,8 +74,6 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K,
V
         @Nullable GridCacheProjectionImpl<K, V> prj,
         boolean async
     ) {
-        super(async);
-
         assert ctx != null;
 
         gate = ctx.gate();
@@ -144,6 +141,24 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K,
V
     }
 
     /** {@inheritDoc} */
+    @Override public IgniteCache<K, V> withAsync() {
+        if (isAsync())
+            return this;
+
+        return new IgniteCacheProxy<>(context(), delegate(), prj, true);
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isAsync() {
+        return lockFreeCache.isAsync();
+    }
+
+    /** {@inheritDoc} */
+    @Override public <R> IgniteFuture<R> future() {
+        return lockFreeCache.future();
+    }
+
+    /** {@inheritDoc} */
     @Override public <C extends Configuration<K, V>> C getConfiguration(Class<C>
clazz) {
         return lockFreeCache.getConfiguration(clazz);
     }
@@ -794,11 +809,6 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K,
V
         }
     }
 
-    /** {@inheritDoc} */
-    @Override protected IgniteCache<K, V> createAsyncInstance() {
-        return lockFreeCache.createAsyncInstance();
-    }
-
     /**
      * Creates projection that will operate with portable objects. <p> Projection returned
by this method will force
      * cache not to deserialize portable objects, so keys and values will be returned from
cache API methods without


Mime
View raw message