Example usage for org.springframework.integration.context IntegrationContextUtils MESSAGING_ANNOTATION_POSTPROCESSOR_NAME

List of usage examples for org.springframework.integration.context IntegrationContextUtils MESSAGING_ANNOTATION_POSTPROCESSOR_NAME

Introduction

In this page you can find the example usage for org.springframework.integration.context IntegrationContextUtils MESSAGING_ANNOTATION_POSTPROCESSOR_NAME.

Prototype

String MESSAGING_ANNOTATION_POSTPROCESSOR_NAME

To view the source code for org.springframework.integration.context IntegrationContextUtils MESSAGING_ANNOTATION_POSTPROCESSOR_NAME.

Click Source Link

Usage

From source file:org.springframework.integration.config.IntegrationRegistrar.java

/**
 * Register {@link MessagingAnnotationPostProcessor} and {@link PublisherAnnotationBeanPostProcessor}, if necessary.
 * Inject {@code defaultPublishedChannel} from provided {@link AnnotationMetadata}, if any.
 * @param meta The {@link AnnotationMetadata} to get additional properties for {@link BeanDefinition}s.
 * @param registry The {@link BeanDefinitionRegistry} to register additional {@link BeanDefinition}s.
 *//*from w w  w.j a v a2 s .  co  m*/
private void registerMessagingAnnotationPostProcessors(AnnotationMetadata meta,
        BeanDefinitionRegistry registry) {
    if (!registry.containsBeanDefinition(IntegrationContextUtils.MESSAGING_ANNOTATION_POSTPROCESSOR_NAME)) {
        BeanDefinitionBuilder builder = BeanDefinitionBuilder
                .genericBeanDefinition(MessagingAnnotationPostProcessor.class)
                .setRole(BeanDefinition.ROLE_INFRASTRUCTURE);

        registry.registerBeanDefinition(IntegrationContextUtils.MESSAGING_ANNOTATION_POSTPROCESSOR_NAME,
                builder.getBeanDefinition());
    }

    new PublisherRegistrar().registerBeanDefinitions(meta, registry);
}