duxinglangzi
2022-04-22 de8c2b2a4654893dc2c80f1fe095c165485bee5f
提交 | 用户 | age
de8c2b 1 package com.duxinglangzi.canal.starter.configuration;
D 2
3 import org.springframework.beans.factory.support.BeanDefinitionRegistry;
4 import org.springframework.beans.factory.support.RootBeanDefinition;
5 import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
6 import org.springframework.core.type.AnnotationMetadata;
7
8 /**
9  * @author wuqiong 2022/4/12
10  * @description
11  */
12 public class CanalBootstrapConfiguration implements ImportBeanDefinitionRegistrar {
13
14     public static final String CANAL_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME =
15             "com.duxinglangzi.canal.starter.configuration.CanalListenerAnnotationBeanPostProcessor";
16
17     @Override
18     public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
19         if (!registry.containsBeanDefinition(CANAL_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME)) {
20
21             registry.registerBeanDefinition(CANAL_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME,
22                     new RootBeanDefinition(CanalListenerAnnotationBeanPostProcessor.class));
23         }
24
25
26     }
27
28 }