Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish /apache/dubbo#3695 : @Reference field can't refer its' @Servic… #4385

Merged
merged 1 commit into from
Jun 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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.