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

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

Introduction

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

Prototype

String NULL_CHANNEL_BEAN_NAME

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

Click Source Link

Usage

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

/**
 * Register a null channel in the given BeanDefinitionRegistry. The bean name is defined by the constant
 * {@link IntegrationContextUtils#NULL_CHANNEL_BEAN_NAME}.
 *///from  w  ww .  j av  a2 s.  c o m
private void registerNullChannel(BeanDefinitionRegistry registry) {
    if (registry.containsBeanDefinition(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME)) {
        BeanDefinition nullChannelDefinition = registry
                .getBeanDefinition(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME);
        if (NullChannel.class.getName().equals(nullChannelDefinition.getBeanClassName())) {
            return;
        } else {
            throw new IllegalStateException(
                    "The bean name '" + IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME + "' is reserved.");
        }
    } else {
        RootBeanDefinition nullChannelDef = new RootBeanDefinition();
        nullChannelDef.setBeanClassName(IntegrationConfigUtils.BASE_PACKAGE + ".channel.NullChannel");
        BeanDefinitionHolder nullChannelHolder = new BeanDefinitionHolder(nullChannelDef,
                IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME);
        BeanDefinitionReaderUtils.registerBeanDefinition(nullChannelHolder, registry);
    }
}

From source file:org.springframework.integration.config.xml.DefaultConfiguringBeanFactoryPostProcessor.java

/**
 * Register a null channel in the given BeanDefinitionRegistry. The bean name is defined by the constant
 * {@link IntegrationContextUtils#NULL_CHANNEL_BEAN_NAME}.
 *///  ww  w.ja  va 2s .c  o m
private void registerNullChannel(BeanDefinitionRegistry registry) {
    if (registry.containsBeanDefinition(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME)) {
        BeanDefinition nullChannelDefinition = registry
                .getBeanDefinition(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME);
        if (NullChannel.class.getName().equals(nullChannelDefinition.getBeanClassName())) {
            return;
        } else {
            throw new IllegalStateException(
                    "The bean name '" + IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME + "' is reserved.");
        }
    } else {
        RootBeanDefinition nullChannelDef = new RootBeanDefinition();
        nullChannelDef.setBeanClassName(IntegrationNamespaceUtils.BASE_PACKAGE + ".channel.NullChannel");
        BeanDefinitionHolder nullChannelHolder = new BeanDefinitionHolder(nullChannelDef,
                IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME);
        BeanDefinitionReaderUtils.registerBeanDefinition(nullChannelHolder, registry);
    }
}