|
1 | 1 | package com.tuya.connector.open.messaging.autoconfig;
|
2 | 2 |
|
3 |
| -import com.tuya.connector.open.messaging.MessageRegister; |
4 | 3 | import com.tuya.connector.open.messaging.TuyaMessageDispatcher;
|
5 | 4 | import lombok.extern.slf4j.Slf4j;
|
6 |
| -import org.springframework.beans.factory.support.BeanDefinitionRegistry; |
7 | 5 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
8 | 6 | import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
9 | 7 | import org.springframework.context.annotation.Bean;
|
10 | 8 | import org.springframework.context.annotation.Configuration;
|
11 |
| -import org.springframework.context.annotation.ImportBeanDefinitionRegistrar; |
12 |
| -import org.springframework.core.annotation.AnnotationAttributes; |
13 |
| -import org.springframework.core.type.AnnotationMetadata; |
14 | 9 | import org.springframework.util.StringUtils;
|
15 | 10 |
|
16 |
| -import java.util.HashSet; |
17 |
| -import java.util.Set; |
18 |
| - |
19 | 11 | /**
|
20 | 12 | * <p> TODO
|
21 | 13 | *
|
|
26 | 18 | @Slf4j
|
27 | 19 | @Configuration
|
28 | 20 | @EnableConfigurationProperties(MessageProperties.class)
|
29 |
| -public class MessageAutoConfiguration implements ImportBeanDefinitionRegistrar { |
| 21 | +public class MessageAutoConfiguration { |
30 | 22 |
|
31 | 23 | private final MessageProperties messageProperties;
|
32 | 24 |
|
@@ -61,17 +53,4 @@ public TuyaMessageDataSource tuyaMessageDataSource() {
|
61 | 53 | messageProperties.getSubNameSuffix()
|
62 | 54 | );
|
63 | 55 | }
|
64 |
| - |
65 |
| - @Override |
66 |
| - public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry beanDefinitionRegistry) { |
67 |
| - AnnotationAttributes attributes = AnnotationAttributes.fromMap(annotationMetadata.getAnnotationAttributes(EnableMessaging.class.getName())); |
68 |
| - Set<String> pkgPaths = new HashSet<>(); |
69 |
| - if (attributes != null) { |
70 |
| - String[] paths = attributes.getStringArray("msgPaths"); |
71 |
| - for (String path : paths) { |
72 |
| - pkgPaths.add(path); |
73 |
| - } |
74 |
| - } |
75 |
| - MessageRegister.init(pkgPaths); |
76 |
| - } |
77 | 56 | }
|
0 commit comments