All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mydao.eventbus.spring.support.EventBusBootstrapConfiguration Maven / Gradle / Ivy

There is a newer version: 1.0.8
Show newest version
package com.mydao.eventbus.spring.support;

import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;

/**
 *
 * @author : ahoo wang
 */
public class EventBusBootstrapConfiguration implements ImportBeanDefinitionRegistrar {
    @Override
    public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {

        if (!registry.containsBeanDefinition(PublishAnnotationAspect.BEAN_NAME)) {
            registry.registerBeanDefinition(PublishAnnotationAspect.BEAN_NAME,
                    new RootBeanDefinition(PublishAnnotationAspect.class));
        }

        if (!registry.containsBeanDefinition(SubscribeAnnotationBeanPostProcessor.BEAN_NAME)) {
            registry.registerBeanDefinition(SubscribeAnnotationBeanPostProcessor.BEAN_NAME,
                    new RootBeanDefinition(SubscribeAnnotationBeanPostProcessor.class));
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy