private void processIntegrationComponentSpec(String beanName, IntegrationComponentSpec<?, ?> bean) { Object target = bean.get(); invokeBeanInitializationHooks(beanName, target); if (bean instanceof ComponentsRegistration) { Map<Object, String> componentsToRegister = ((ComponentsRegistration) bean).getComponentsToRegister(); if (!CollectionUtils.isEmpty(componentsToRegister)) { componentsToRegister.entrySet() .stream() .filter(component -> noBeanPresentForComponent(component.getKey(), beanName)) .forEach(component -> registerComponent(component.getKey(), generateBeanName(component.getKey(), component.getValue()))); } } }
@Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof StandardIntegrationFlow) { return processStandardIntegrationFlow((StandardIntegrationFlow) bean, beanName); } else if (bean instanceof IntegrationFlow) { return processIntegrationFlowImpl((IntegrationFlow) bean, beanName); } if (bean instanceof IntegrationComponentSpec) { processIntegrationComponentSpec(beanName, (IntegrationComponentSpec<?, ?>) bean); } return bean; }
id = generateBeanName(endpoint, flowNamePrefix, entry.getValue(), useFlowIdAsPrefix); if (noBeanPresentForComponent(messageHandler, flowBeanName)) { String handlerBeanName = generateBeanName(messageHandler, flowNamePrefix); registerComponent(messageHandler, handlerBeanName, flowBeanName); this.beanFactory.registerAlias(handlerBeanName, id + IntegrationConfigUtils.HANDLER_ALIAS_SUFFIX); registerComponent(endpoint, id, flowBeanName); targetIntegrationComponents.put(endpoint, id); if (noBeanPresentForComponent(component, flowBeanName)) { if (component instanceof AbstractMessageChannel || component instanceof NullChannel) { String channelBeanName = ((NamedComponent) component).getComponentName(); registerComponent(component, channelBeanName, flowBeanName); targetIntegrationComponents.put(component, channelBeanName); if (!this.beanFactory.containsBean(channelBeanName)) { DirectChannel directChannel = new DirectChannel(); registerComponent(directChannel, channelBeanName, flowBeanName); targetIntegrationComponents.put(directChannel, channelBeanName); registerComponent(component, channelBeanName, flowBeanName); targetIntegrationComponents.put(component, channelBeanName); componentsToRegister.entrySet() .stream() .filter(o -> noBeanPresentForComponent(o.getKey(), flowBeanName))
private String generateBeanName(Object instance, String prefix) { return generateBeanName(instance, prefix, null, false); }
private void registerComponent(Object component, String beanName) { registerComponent(component, beanName, null); }
processStandardIntegrationFlow(target, beanName);
id = generateBeanName(endpoint, flowNamePrefix, entry.getValue(), useFlowIdAsPrefix); if (noBeanPresentForComponent(messageHandler, flowBeanName)) { String handlerBeanName = generateBeanName(messageHandler, flowNamePrefix); registerComponent(messageHandler, handlerBeanName, flowBeanName); this.beanFactory.registerAlias(handlerBeanName, id + IntegrationConfigUtils.HANDLER_ALIAS_SUFFIX); registerComponent(endpoint, id, flowBeanName); targetIntegrationComponents.put(endpoint, id); if (noBeanPresentForComponent(component, flowBeanName)) { if (component instanceof AbstractMessageChannel || component instanceof NullChannel) { String channelBeanName = ((NamedComponent) component).getComponentName(); registerComponent(component, channelBeanName, flowBeanName); targetIntegrationComponents.put(component, channelBeanName); if (!this.beanFactory.containsBean(channelBeanName)) { DirectChannel directChannel = new DirectChannel(); registerComponent(directChannel, channelBeanName, flowBeanName); targetIntegrationComponents.put(directChannel, channelBeanName); registerComponent(component, channelBeanName, flowBeanName); targetIntegrationComponents.put(component, channelBeanName); componentsToRegister.entrySet() .stream() .filter(o -> noBeanPresentForComponent(o.getKey(), flowBeanName))
private String generateBeanName(Object instance, String prefix) { return generateBeanName(instance, prefix, null, false); }
private void registerComponent(Object component, String beanName) { registerComponent(component, beanName, null); }
processStandardIntegrationFlow(target, beanName);
private void processIntegrationComponentSpec(String beanName, IntegrationComponentSpec<?, ?> bean) { Object target = bean.get(); invokeBeanInitializationHooks(beanName, target); if (bean instanceof ComponentsRegistration) { Map<Object, String> componentsToRegister = ((ComponentsRegistration) bean).getComponentsToRegister(); if (!CollectionUtils.isEmpty(componentsToRegister)) { componentsToRegister.entrySet() .stream() .filter(component -> noBeanPresentForComponent(component.getKey(), beanName)) .forEach(component -> registerComponent(component.getKey(), generateBeanName(component.getKey(), component.getValue()))); } } }
@Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof StandardIntegrationFlow) { return processStandardIntegrationFlow((StandardIntegrationFlow) bean, beanName); } else if (bean instanceof IntegrationFlow) { return processIntegrationFlowImpl((IntegrationFlow) bean, beanName); } if (bean instanceof IntegrationComponentSpec) { processIntegrationComponentSpec(beanName, (IntegrationComponentSpec<?, ?>) bean); } return bean; }