Source:
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) { Map<String, Object> annotationAttributes = importingClassMetadata.getAnnotationAttributes(EnablePublisher.class.getName()); String value = (annotationAttributes == null ? null : (String) annotationAttributes.get("value")); if (!registry.containsBeanDefinition(IntegrationContextUtils.PUBLISHER_ANNOTATION_POSTPROCESSOR_NAME)) { BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(PublisherAnnotationBeanPostProcessor.class) .setRole(BeanDefinition.ROLE_INFRASTRUCTURE); if (StringUtils.hasText(value)) { builder.addPropertyValue("defaultChannelName", value); if (logger.isInfoEnabled()) { logger.info("Setting '@Publisher' default-output-channel to '" + value + "'."); } } registry.registerBeanDefinition(IntegrationContextUtils.PUBLISHER_ANNOTATION_POSTPROCESSOR_NAME, builder.getBeanDefinition()); } else { BeanDefinition beanDefinition = registry.getBeanDefinition(IntegrationContextUtils.PUBLISHER_ANNOTATION_POSTPROCESSOR_NAME); MutablePropertyValues propertyValues = beanDefinition.getPropertyValues(); PropertyValue defaultChannelPropertyValue = propertyValues.getPropertyValue("defaultChannelName"); if (StringUtils.hasText(value)) { if (defaultChannelPropertyValue == null) { propertyValues.addPropertyValue("defaultChannelName", value); if (logger.isInfoEnabled()) { logger.info("Setting '@Publisher' default-output-channel to '" + value + "'."); } } else if (!value.equals(defaultChannelPropertyValue.getValue())) { throw new BeanDefinitionStoreException("When more than one enable publisher definition " + "(@EnablePublisher or <annotation-config>)" + " is found in the context, they all must have the same 'default-publisher-channel' value."); } } } }

Target:
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) { Map<String, Object> annotationAttributes = importingClassMetadata.getAnnotationAttributes(EnablePublisher.class.getName()); String value = (annotationAttributes == null ? (String) AnnotationUtils.getDefaultValue(EnablePublisher.class) : (String) annotationAttributes.get("value")); if (!registry.containsBeanDefinition(IntegrationContextUtils.PUBLISHER_ANNOTATION_POSTPROCESSOR_NAME)) { BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(PublisherAnnotationBeanPostProcessor.class) .setRole(BeanDefinition.ROLE_INFRASTRUCTURE); if (StringUtils.hasText(value)) { builder.addPropertyValue("defaultChannelName", value); if (logger.isInfoEnabled()) { logger.info("Setting '@Publisher' default-output-channel to '" + value + "'."); } } registry.registerBeanDefinition(IntegrationContextUtils.PUBLISHER_ANNOTATION_POSTPROCESSOR_NAME, builder.getBeanDefinition()); } else { BeanDefinition beanDefinition = registry.getBeanDefinition(IntegrationContextUtils.PUBLISHER_ANNOTATION_POSTPROCESSOR_NAME); MutablePropertyValues propertyValues = beanDefinition.getPropertyValues(); PropertyValue defaultChannelPropertyValue = propertyValues.getPropertyValue("defaultChannelName"); if (StringUtils.hasText(value)) { if (defaultChannelPropertyValue == null) { propertyValues.addPropertyValue("defaultChannelName", value); if (logger.isInfoEnabled()) { logger.info("Setting '@Publisher' default-output-channel to '" + value + "'."); } } else if (!value.equals(defaultChannelPropertyValue.getValue())) { throw new BeanDefinitionStoreException("When more than one enable publisher definition " + "(@EnablePublisher or <annotation-config>)" + " is found in the context, they all must have the same 'default-publisher-channel' value."); } } } }