From e6e733b3d39c928b2cb549b08c3e621c7c118e95 Mon Sep 17 00:00:00 2001 From: yangfuhai Date: Fri, 23 Mar 2018 09:54:02 +0800 Subject: [PATCH] =?UTF-8?q?fixed=EF=BC=9A=E4=BF=AE=E5=A4=8D=20inject=20?= =?UTF-8?q?=E5=92=8C=20rpc=20=E8=BF=87=E6=BB=A4=E6=97=A0=E6=95=88=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/io/jboot/aop/JbootInjectManager.java | 9 ++++++++- src/main/java/io/jboot/core/rpc/JbootrpcManager.java | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/jboot/aop/JbootInjectManager.java b/src/main/java/io/jboot/aop/JbootInjectManager.java index 9bfb7af11..6d8a9c24a 100644 --- a/src/main/java/io/jboot/aop/JbootInjectManager.java +++ b/src/main/java/io/jboot/aop/JbootInjectManager.java @@ -143,8 +143,15 @@ private void beanBind(Binder binder) { Class[] excludes = beanExclude == null ? default_excludes : ArrayUtils.concat(default_excludes, beanExclude.value()); for (Class interfaceClass : interfaceClasses) { + boolean isContinue = false; for (Class ex : excludes) { - if (ex == interfaceClass) continue; + if (ex.isAssignableFrom(interfaceClass)) { + isContinue = true; + break; + } + } + if (isContinue) { + continue; } try { if (StringUtils.isBlank(name)) { diff --git a/src/main/java/io/jboot/core/rpc/JbootrpcManager.java b/src/main/java/io/jboot/core/rpc/JbootrpcManager.java index df3d0b22b..cfd91600a 100644 --- a/src/main/java/io/jboot/core/rpc/JbootrpcManager.java +++ b/src/main/java/io/jboot/core/rpc/JbootrpcManager.java @@ -82,8 +82,15 @@ public void init() { //对某些系统的类 进行排除,例如:Serializable 等 Class[] excludes = ArrayUtils.concat(default_excludes, rpcService.exclude()); for (Class inter : inters) { + boolean isContinue = false; for (Class ex : excludes) { - if (ex == inter) continue; + if (ex.isAssignableFrom(inter)) { + isContinue = true; + break; + } + } + if (isContinue) { + continue; } getJbootrpc().serviceExport(inter, Jboot.bean(clazz), group, version, port); }