[dubbo-admin] branch develop updated: update dependency version of fastjson (#589)
This is an automated email from the ASF dual-hosted git repository. hyunkun pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/dubbo-admin.git The following commit(s) were added to refs/heads/develop by this push: new 27f85b4 update dependency version of fastjson (#589) 27f85b4 is described below commit 27f85b4254e52434e988b34226f51f9be800d568 Author: chen chen AuthorDate: Fri Apr 24 17:44:39 2020 +0800 update dependency version of fastjson (#589) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ffeee72..449a404 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ 2.7.3 2.12.0 4.1.0 - 1.2.46 + 1.2.67 2.9.2 4.1.42.Final 0.8.2
[dubbo] branch master updated: polish ClassUtils (#6003)
This is an automated email from the ASF dual-hosted git repository. liujun pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new e71ad15 polish ClassUtils (#6003) e71ad15 is described below commit e71ad157b2db8b6133d9ce1413ab80ae31c56652 Author: tangcent AuthorDate: Fri Apr 24 16:10:10 2020 +0800 polish ClassUtils (#6003) use loop instead of recursion --- .../org/apache/dubbo/common/utils/ClassUtils.java | 50 -- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/ClassUtils.java b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/ClassUtils.java index a0b6dee..2fb515c 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/ClassUtils.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/ClassUtils.java @@ -21,20 +21,19 @@ import java.lang.reflect.Array; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Arrays; -import java.util.Collection; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashSet; +import java.util.LinkedList; import java.util.Map; import java.util.Objects; +import java.util.Queue; import java.util.Set; import java.util.function.Predicate; -import static java.util.Arrays.asList; import static java.util.Collections.emptySet; import static java.util.Collections.unmodifiableSet; -import static java.util.stream.Collectors.toList; import static org.apache.dubbo.common.function.Streams.filterAll; import static org.apache.dubbo.common.utils.ArrayUtils.isNotEmpty; import static org.apache.dubbo.common.utils.CollectionUtils.ofSet; @@ -360,12 +359,10 @@ public class ClassUtils { Set> allSuperClasses = new LinkedHashSet<>(); Class superClass = type.getSuperclass(); - -if (superClass != null) { +while (superClass != null) { // add current super class allSuperClasses.add(superClass); -// add ancestor classes -allSuperClasses.addAll(getAllSuperClasses(superClass)); +superClass = superClass.getSuperclass(); } return unmodifiableSet(filterAll(allSuperClasses, classFilters)); @@ -380,30 +377,39 @@ public class ClassUtils { * @since 2.7.6 */ public static Set> getAllInterfaces(Class type, Predicate>... interfaceFilters) { - if (type == null || type.isPrimitive()) { return emptySet(); } Set> allInterfaces = new LinkedHashSet<>(); +Set> resolved = new LinkedHashSet<>(); +Queue> waitResolve = new LinkedList<>(); + +resolved.add(type); +Class clazz = type; +while (clazz != null) { + +Class[] interfaces = clazz.getInterfaces(); + +if (isNotEmpty(interfaces)) { +// add current interfaces +Arrays.stream(interfaces) +.filter(resolved::add) +.forEach(cls -> { +allInterfaces.add(cls); +waitResolve.add(cls); +}); +} -Class[] interfaces = type.getInterfaces(); +// add all super classes to waitResolve +getAllSuperClasses(clazz) +.stream() +.filter(resolved::add) +.forEach(waitResolve::add); -if (isNotEmpty(interfaces)) { -// add current interfaces -allInterfaces.addAll(asList(interfaces)); +clazz = waitResolve.poll(); } -// add all super interfaces -getAllSuperClasses(type).forEach(superType -> allInterfaces.addAll(getAllInterfaces(superType))); - -// add all super interfaces from all interfaces -allInterfaces.stream() -.map(ClassUtils::getAllInterfaces) -.flatMap(Collection::stream) -.collect(toList()) -.forEach(allInterfaces::add); - return filterAll(allInterfaces, interfaceFilters); }
[dubbo] branch master updated: set reference bean definition target type (#5710)
This is an automated email from the ASF dual-hosted git repository. mercyblitz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 2ccd50f set reference bean definition target type (#5710) 2ccd50f is described below commit 2ccd50f0780c619f353d8d4ede1ab0647cbe2733 Author: mooseen AuthorDate: Fri Apr 24 14:49:31 2020 +0800 set reference bean definition target type (#5710) Co-authored-by: quzijing --- .../dubbo/config/spring/schema/DubboBeanDefinitionParser.java | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/schema/DubboBeanDefinitionParser.java b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/schema/DubboBeanDefinitionParser.java index 9c5d9c1..1cf027a 100644 --- a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/schema/DubboBeanDefinitionParser.java +++ b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/schema/DubboBeanDefinitionParser.java @@ -129,7 +129,13 @@ public class DubboBeanDefinitionParser implements BeanDefinitionParser { parseProperties(element.getChildNodes(), classDefinition); beanDefinition.getPropertyValues().addPropertyValue("ref", new BeanDefinitionHolder(classDefinition, id + "Impl")); } -} else if (ProviderConfig.class.equals(beanClass)) { +} else if(ReferenceBean.class.equals(beanClass)){ +String interfaceClassName = element.getAttribute("interface"); +if(StringUtils.isNotEmpty(interfaceClassName)){ +Class interfaceClass = ReflectUtils.forName(interfaceClassName); +beanDefinition.setTargetType(interfaceClass); +} +}else if (ProviderConfig.class.equals(beanClass)) { parseNested(element, parserContext, ServiceBean.class, true, "service", "provider", id, beanDefinition); } else if (ConsumerConfig.class.equals(beanClass)) { parseNested(element, parserContext, ReferenceBean.class, false, "reference", "consumer", id, beanDefinition);
[dubbo-kubernetes] branch master updated: update README.md
This is an automated email from the ASF dual-hosted git repository. liujun pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-kubernetes.git The following commit(s) were added to refs/heads/master by this push: new b20910d update README.md b20910d is described below commit b20910dda7dc6c84584d50de90bfc811db037a71 Author: ken.lj AuthorDate: Fri Apr 24 14:15:19 2020 +0800 update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ad9ca1e..662a923 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Dubbo integration with k8s # 初步思考 -kubernetes是天然可作为微服务的地址注册中心,类似于zookeeper, 阿里巴巴内部用到的VIPserver,Configserver。 具体来说,kubernetes中的Pod是对于应用的运行实例,Pod的被调度部署/启停都会调用API-Server的服务来保持其状态到ETCD;kubernetes中的service是对应微服务的概念,定义如下 +kubernetes是天然可作为微服务的地址注册中心,类似于zookeeper、Consul。 具体来说,kubernetes中的Pod是对于应用的运行实例,Pod的被调度部署/启停都会调用API-Server的服务来保持其状态到ETCD;kubernetes中的service是对应微服务的概念,定义如下 A Kubernetes Service is an abstraction layer which defines a logical set of Pods and enables external traffic exposure, load balancing and service discovery for those Pods.