Skip to content

Commit

Permalink
Polish /apache#3695 : @reference field can't refer its' @service Bean…
Browse files Browse the repository at this point in the history
… in same JVM from v2.6.6
  • Loading branch information
mercyblitz committed Jun 25, 2019
1 parent ffce958 commit 6126d66
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 238 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.alibaba.dubbo.config.spring.ServiceBean;
import com.alibaba.dubbo.config.spring.context.event.ServiceBeanExportedEvent;
import com.alibaba.dubbo.config.spring.util.AnnotationUtils;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.InjectionMetadata;
import org.springframework.context.ApplicationContext;
Expand Down Expand Up @@ -105,7 +104,7 @@ public Map<InjectionMetadata.InjectedElement, ReferenceBean<?>> getInjectedMetho
}

@Override
protected Object doGetInjectedBean(Reference reference, Object bean, String beanName, Class<?> injectedType,
protected Object doGetInjectedBean(Reference reference, Object bean, String beanName, Class<?> injectedType,
InjectionMetadata.InjectedElement injectedElement) throws Exception {

String referencedBeanName = buildReferencedBeanName(reference, injectedType);
Expand Down Expand Up @@ -188,9 +187,7 @@ protected String buildInjectedObjectCacheKey(Reference reference, Object bean, S

private String buildReferencedBeanName(Reference reference, Class<?> injectedType) {

AnnotationBeanNameBuilder builder = AnnotationBeanNameBuilder.create(reference, injectedType);

builder.environment(getEnvironment());
ServiceBeanNameBuilder builder = ServiceBeanNameBuilder.create(reference, injectedType, getEnvironment());

return getEnvironment().resolvePlaceholders(builder.build());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.alibaba.dubbo.config.annotation.Service;
import com.alibaba.dubbo.config.spring.ServiceBean;
import com.alibaba.dubbo.config.spring.context.annotation.DubboClassPathBeanDefinitionScanner;

import org.springframework.beans.BeansException;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.factory.BeanClassLoaderAware;
Expand Down Expand Up @@ -291,9 +290,7 @@ private void registerServiceBean(BeanDefinitionHolder beanDefinitionHolder, Bean
*/
private String generateServiceBeanName(Service service, Class<?> interfaceClass, String annotatedServiceBeanName) {

AnnotationBeanNameBuilder builder = AnnotationBeanNameBuilder.create(service, interfaceClass);

builder.environment(environment);
ServiceBeanNameBuilder builder = ServiceBeanNameBuilder.create(service, interfaceClass, environment);

return builder.build();
}
Expand Down Expand Up @@ -439,7 +436,7 @@ private AbstractBeanDefinition buildServiceBeanDefinition(Service service, Class

Method[] methods = service.methods();
List<MethodConfig> methodConfigs = MethodConfig.constructMethodConfig(methods);
if(!methodConfigs.isEmpty()){
if (!methodConfigs.isEmpty()) {
builder.addPropertyValue("methods", methodConfigs);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.alibaba.dubbo.config.annotation.Service;
import com.alibaba.dubbo.config.spring.ReferenceBean;
import com.alibaba.dubbo.config.spring.ServiceBean;

import org.springframework.core.env.Environment;
import org.springframework.util.StringUtils;

Expand All @@ -35,9 +34,7 @@
* @see ServiceBean
* @see ReferenceBean
* @since 2.6.5
* @deprecated {@link AnnotationBeanNameBuilder} as the replacement
*/
@Deprecated
class ServiceBeanNameBuilder {

private static final String SEPARATOR = ":";
Expand Down

This file was deleted.

0 comments on commit 6126d66

Please sign in to comment.