From b11d95e7b674d2d69b48f3cf255ab05ad3dd2876 Mon Sep 17 00:00:00 2001 From: y277an Date: Fri, 14 Jun 2019 18:43:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/xiaohui/configurer/rpc/RpcFactory.java | 1 + .../main/java/com/xiaohui/configurer/rpc/RpcFactoryBean.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/netty-rpc/rpc-consumer/src/main/java/com/xiaohui/configurer/rpc/RpcFactory.java b/netty-rpc/rpc-consumer/src/main/java/com/xiaohui/configurer/rpc/RpcFactory.java index eee74d0..b7f3ee2 100755 --- a/netty-rpc/rpc-consumer/src/main/java/com/xiaohui/configurer/rpc/RpcFactory.java +++ b/netty-rpc/rpc-consumer/src/main/java/com/xiaohui/configurer/rpc/RpcFactory.java @@ -30,6 +30,7 @@ public class RpcFactory implements InvocationHandler { Logger logger = LoggerFactory.getLogger(this.getClass()); + @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Request request = new Request(); request.setClassName(method.getDeclaringClass().getName()); diff --git a/netty-rpc/rpc-consumer/src/main/java/com/xiaohui/configurer/rpc/RpcFactoryBean.java b/netty-rpc/rpc-consumer/src/main/java/com/xiaohui/configurer/rpc/RpcFactoryBean.java index 04fe7ff..aea52f2 100755 --- a/netty-rpc/rpc-consumer/src/main/java/com/xiaohui/configurer/rpc/RpcFactoryBean.java +++ b/netty-rpc/rpc-consumer/src/main/java/com/xiaohui/configurer/rpc/RpcFactoryBean.java @@ -23,11 +23,11 @@ public RpcFactoryBean() { public RpcFactoryBean(Class rpcInterface) { this.rpcInterface = rpcInterface; } - + // 返回的对象实例 public T getObject() throws Exception { return (T) Proxy.newProxyInstance(rpcInterface.getClassLoader(), new Class[]{rpcInterface}, factory); } - + // Bean的类型 public Class getObjectType() { return this.rpcInterface; }