CrazyHZM commented on a change in pull request #9093:
URL: https://github.com/apache/dubbo/pull/9093#discussion_r734915605



##########
File path: 
dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/config/DubboConfigBeanPostProcessor.java
##########
@@ -44,13 +55,51 @@
  *
  * @since 2.7.6
  */
-public class DubboConfigDefaultPropertyValueBeanPostProcessor extends 
GenericBeanPostProcessorAdapter<AbstractConfig>
-        implements MergedBeanDefinitionPostProcessor, PriorityOrdered {
+public class DubboConfigBeanPostProcessor extends 
GenericBeanPostProcessorAdapter<AbstractConfig>
+    implements BeanDefinitionRegistryPostProcessor, PriorityOrdered, 
ApplicationContextAware {
 
     /**
-     * The bean name of {@link 
DubboConfigDefaultPropertyValueBeanPostProcessor}
+     * The bean name of {@link DubboConfigBeanPostProcessor}
      */
-    public static final String BEAN_NAME = 
"dubboConfigDefaultPropertyValueBeanPostProcessor";
+    public static final String BEAN_NAME = "dubboConfigBeanPostProcessor";
+
+    private ModuleModel moduleModel;
+    private ApplicationModel applicationModel;
+
+    @Override
+    public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry 
registry) throws BeansException {
+        //DO NOTHING
+    }
+
+    @Override
+    public void postProcessBeanFactory(ConfigurableListableBeanFactory 
beanFactory) throws BeansException {
+        String[] beanNames = beanFactory.getBeanDefinitionNames();
+        for (String beanName : beanNames) {
+            BeanDefinition beanDefinition = 
beanFactory.getBeanDefinition(beanName);
+            String beanClassName = beanDefinition.getBeanClassName();
+            if (beanClassName != null && 
beanClassName.startsWith("org.apache.dubbo.config.")) {
+                try {

Review comment:
       Can it be adjusted to be inserted by judging the existence of this 
`ScopeModel` type of input parameter in the constructor.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to