sunrui1225 commented on code in PR #5399:
URL: https://github.com/apache/incubator-seata/pull/5399#discussion_r1435530900
##########
spring/src/main/java/io/seata/spring/annotation/GlobalTransactionScanner.java:
##########
@@ -469,8 +480,68 @@ public void afterPropertiesSet() {
if (initialized.compareAndSet(false, true)) {
initClient();
}
+
+ this.findBusinessBeanNamesNeededEnhancement();
+ }
+
+ private void findBusinessBeanNamesNeededEnhancement() {
+ if (applicationContext instanceof ConfigurableApplicationContext) {
+ ConfigurableApplicationContext configurableApplicationContext =
(ConfigurableApplicationContext) applicationContext;
+ ConfigurableListableBeanFactory configurableListableBeanFactory =
configurableApplicationContext.getBeanFactory();
+
+ String[] beanNames = applicationContext.getBeanDefinitionNames();
+ for (String contextBeanName : beanNames) {
+ BeanDefinition beanDefinition =
configurableListableBeanFactory.getBeanDefinition(contextBeanName);
+ if
(IGNORE_ENHANCE_CHECK_SET.contains(beanDefinition.getBeanClassName())) {
+ continue;
+ }
+ try {
+ // get the class by bean definition class name
+ Class<?> beanClass =
Class.forName(beanDefinition.getBeanClassName());
+ // check if it needs enhancement by the class
+ IfNeedEnhanceBean ifNeedEnhanceBean =
DefaultInterfaceParser.get().parseIfNeedEnhancement(beanClass);
+ if (!ifNeedEnhanceBean.isIfNeed()) {
+ continue;
+ }
+ if
(ifNeedEnhanceBean.getNeedEnhanceEnum().equals(NeedEnhanceEnum.SERVICE_BEAN)) {
+ // the native bean which dubbo, sofa bean service bean
referenced
+ PropertyValue propertyValue =
beanDefinition.getPropertyValues().getPropertyValue("ref");
Review Comment:
试了一下,com.alibaba.dubbo.config.annotation.Service,像这种带有dubbo 注解的 service是支持的
--
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]