Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-648 c797886a0 -> 02bcadd55


# ignite-648: get proxy


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

Branch: refs/heads/ignite-648
Commit: cf6c040a83e29d08a5a2cdae906bd546928a973b
Parents: c797886
Author: Artem Shutak <ashu...@gridgain.com>
Authored: Tue Apr 21 15:17:42 2015 +0300
Committer: Artem Shutak <ashu...@gridgain.com>
Committed: Tue Apr 21 15:17:42 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/multijvm/CacheProxy.java   | 22 +++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf6c040a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/CacheProxy.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/CacheProxy.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/CacheProxy.java
index 52f9aea..b070445 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/CacheProxy.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/CacheProxy.java
@@ -37,10 +37,12 @@ import java.util.concurrent.locks.*;
 public class CacheProxy<K, V> implements IgniteCache<K, V> {
     private transient IgniteExProxy proxy;
     private final String cacheName;
+    private final UUID gridId;
 
     public CacheProxy(String name, IgniteExProxy proxy) {
         this.proxy = proxy;
         cacheName = name;
+        gridId = proxy.getId();
     }
 
     @Override public IgniteCache<K, V> withAsync() {
@@ -136,8 +138,26 @@ public class CacheProxy<K, V> implements IgniteCache<K, V> 
{
     }
 
     @Override public V get(K key) {
-        return null; // TODO: CODE: implement.
+        ClusterGroup grp = 
proxy.localJvmGrid().cluster().forNodeId(proxy.getId());
+
+        IgniteCompute compute = proxy.localJvmGrid().compute(grp);
+
+        return compute.broadcast(new MyClos2<K, V>(gridId, cacheName), 
key).iterator().next();
     }
+    
+    public static class MyClos2<K, V> extends IgniteClosureX<K, V> {
+        private final UUID id;
+        private final String name;
+
+        public MyClos2(UUID id, String name) {
+            this.id = id;
+            this.name = name;
+        }
+
+        @Override public V applyx(K k) {
+            return (V)Ignition.ignite(id).cache(name).get(k);
+        }
+    } 
 
     @Override public Map<K, V> getAll(Set<? extends K> keys) {
         return null; // TODO: CODE: implement.

Reply via email to