From a61dad02761df5e43b9ee5acff1258fad5f07736 Mon Sep 17 00:00:00 2001 From: syd Date: Fri, 21 Apr 2017 14:34:10 +0800 Subject: [PATCH] =?UTF-8?q?Invoker=E6=B2=A1=E6=9C=89=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E9=94=80=E6=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dubbo/rpc/protocol/memcached/MemcachedProtocol.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dubbo-rpc/dubbo-rpc-memcached/src/main/java/com/alibaba/dubbo/rpc/protocol/memcached/MemcachedProtocol.java b/dubbo-rpc/dubbo-rpc-memcached/src/main/java/com/alibaba/dubbo/rpc/protocol/memcached/MemcachedProtocol.java index 9439129dafca..5c13db419a0d 100644 --- a/dubbo-rpc/dubbo-rpc-memcached/src/main/java/com/alibaba/dubbo/rpc/protocol/memcached/MemcachedProtocol.java +++ b/dubbo-rpc/dubbo-rpc-memcached/src/main/java/com/alibaba/dubbo/rpc/protocol/memcached/MemcachedProtocol.java @@ -39,7 +39,7 @@ /** * MemcachedProtocol - * + * * @author william.liangf */ public class MemcachedProtocol extends AbstractProtocol { @@ -67,7 +67,7 @@ public Invoker refer(final Class type, final URL url) throws RpcExcept final String get = url.getParameter("get", "get"); final String set = url.getParameter("set", Map.class.equals(type) ? "put" : "set"); final String delete = url.getParameter("delete", Map.class.equals(type) ? "remove" : "delete"); - return new AbstractInvoker(type, url) { + Invoker invoker = new AbstractInvoker(type, url) { protected Result doInvoke(Invocation invocation) throws Throwable { try { if (get.equals(invocation.getMethodName())) { @@ -109,6 +109,8 @@ public void destroy() { } } }; + invokers.add(invoker); + return invoker; } catch (Throwable t) { throw new RpcException("Failed to refer memecached service. interface: " + type.getName() + ", url: " + url + ", cause: " + t.getMessage(), t); }