/** * Populate the {@link MessageChannel} name to the new {@link IntegrationFlowBuilder} chain. * The {@link org.springframework.integration.dsl.IntegrationFlow} {@code inputChannel}. * @param messageChannelName the name of existing {@link MessageChannel} bean. * The new {@link DirectChannel} bean will be created on context startup * if there is no bean with this name. * @return new {@link IntegrationFlowBuilder}. */ public static IntegrationFlowBuilder from(String messageChannelName) { return from(new MessageChannelReference(messageChannelName)); }
String channelName = null; if (outputChannel instanceof MessageChannelReference) { channelName = ((MessageChannelReference) outputChannel).getName();
String channelBeanName = ((MessageChannelReference) component).getName(); if (!this.beanFactory.containsBean(channelBeanName)) { DirectChannel directChannel = new DirectChannel();
/** * Populate a {@link MessageChannelReference} instance * at the current {@link IntegrationFlow} chain position. * The provided {@code messageChannelName} is used for the bean registration * ({@link org.springframework.integration.channel.DirectChannel}), if there is no such a bean * in the application context. Otherwise the existing {@link MessageChannel} bean is used * to wire integration endpoints. * @param messageChannelName the bean name to use. * @return the current {@link IntegrationFlowDefinition}. */ public B channel(String messageChannelName) { return channel(new MessageChannelReference(messageChannelName)); }
@SuppressWarnings("unchecked") private <S extends ConsumerEndpointSpec<S, ? extends MessageHandler>> B register(S endpointSpec, Consumer<S> endpointConfigurer) { if (endpointConfigurer != null) { endpointConfigurer.accept(endpointSpec); } MessageChannel inputChannel = this.currentMessageChannel; this.currentMessageChannel = null; if (inputChannel == null) { inputChannel = new DirectChannel(); this.registerOutputChannelIfCan(inputChannel); } Tuple2<ConsumerEndpointFactoryBean, ? extends MessageHandler> factoryBeanTuple2 = endpointSpec.get(); addComponents(endpointSpec.getComponentsToRegister()); if (inputChannel instanceof MessageChannelReference) { factoryBeanTuple2.getT1().setInputChannelName(((MessageChannelReference) inputChannel).getName()); } else { if (inputChannel instanceof FixedSubscriberChannelPrototype) { String beanName = ((FixedSubscriberChannelPrototype) inputChannel).getName(); inputChannel = new FixedSubscriberChannel(factoryBeanTuple2.getT2()); if (beanName != null) { ((FixedSubscriberChannel) inputChannel).setBeanName(beanName); } registerOutputChannelIfCan(inputChannel); } factoryBeanTuple2.getT1().setInputChannel(inputChannel); } return addComponent(endpointSpec).currentComponent(factoryBeanTuple2.getT2()); }
/** * Populate the {@link MessageChannel} name to the new {@link IntegrationFlowBuilder} chain. * The {@link org.springframework.integration.dsl.IntegrationFlow} {@code inputChannel}. * @param messageChannelName the name of existing {@link MessageChannel} bean. * The new {@link DirectChannel} bean will be created on context startup * if there is no bean with this name. * @return new {@link IntegrationFlowBuilder}. */ public static IntegrationFlowBuilder from(String messageChannelName) { return from(new MessageChannelReference(messageChannelName)); }
private MessageChannel resolveChannelName(MessageChannelReference channelReference) { String channelName = channelReference.getName(); try { return DslRecipientListRouter.this.getBeanFactory().getBean(channelName, MessageChannel.class); } catch (BeansException e) { throw new DestinationResolutionException("Failed to look up MessageChannel with name '" + channelName + "' in the BeanFactory."); } }
/** * Populate a {@link MessageChannelReference} instance * at the current {@link IntegrationFlow} chain position. * The provided {@code messageChannelName} is used for the bean registration * ({@link org.springframework.integration.channel.DirectChannel}), if there is no such a bean * in the application context. Otherwise the existing {@link MessageChannel} bean is used * to wire integration endpoints. * @param messageChannelName the bean name to use. * @return the current {@link IntegrationFlowDefinition}. */ public B channel(String messageChannelName) { return channel(new MessageChannelReference(messageChannelName)); }
private MessageChannel resolveChannelName(MessageChannelReference channelReference) { String channelName = channelReference.getName(); try { return DslRecipientListRouter.this.getBeanFactory().getBean(channelName, MessageChannel.class); } catch (BeansException e) { throw new DestinationResolutionException("Failed to look up MessageChannel with name '" + channelName + "' in the BeanFactory."); } }
/** * Populate the {@link MessageChannel} name to the new {@link IntegrationFlowBuilder} chain. * The {@link org.springframework.integration.dsl.IntegrationFlow} {@code inputChannel}. * @param messageChannelName the name of existing {@link MessageChannel} bean. * The new {@link DirectChannel} bean will be created on context startup * if there is no bean with this name. * @return new {@link IntegrationFlowBuilder}. */ public static IntegrationFlowBuilder from(String messageChannelName) { return from(new MessageChannelReference(messageChannelName)); }
String channelName = null; if (outputChannel instanceof MessageChannelReference) { channelName = ((MessageChannelReference) outputChannel).getName();
/** * Populate the {@link MessageChannel} name to the new {@link IntegrationFlowBuilder} chain. * The {@link org.springframework.integration.dsl.IntegrationFlow} {@code inputChannel}. * @param messageChannelName the name of existing {@link MessageChannel} bean. * The new {@link DirectChannel} bean will be created on context startup * if there is no bean with this name. * @return new {@link IntegrationFlowBuilder}. */ public static IntegrationFlowBuilder from(String messageChannelName) { return from(new MessageChannelReference(messageChannelName)); }
String channelBeanName = ((MessageChannelReference) component).getName(); if (!this.beanFactory.containsBean(channelBeanName)) { DirectChannel directChannel = new DirectChannel();
/** * Populate a {@link MessageChannelReference} instance * at the current {@link IntegrationFlow} chain position. * The provided {@code messageChannelName} is used for the bean registration * ({@link org.springframework.integration.channel.DirectChannel}), if there is no such a bean * in the application context. Otherwise the existing {@link MessageChannel} bean is used * to wire integration endpoints. * @param messageChannelName the bean name to use. * @return the current {@link IntegrationFlowDefinition}. */ public B channel(String messageChannelName) { return channel(new MessageChannelReference(messageChannelName)); }
String channelName = null; if (outputChannel instanceof MessageChannelReference) { channelName = ((MessageChannelReference) outputChannel).getName();
/** * Populate a {@link MessageChannelReference} instance * at the current {@link IntegrationFlow} chain position. * The provided {@code messageChannelName} is used for the bean registration * ({@link org.springframework.integration.channel.DirectChannel}), if there is no such a bean * in the application context. Otherwise the existing {@link MessageChannel} bean is used * to wire integration endpoints. * @param messageChannelName the bean name to use. * @return the current {@link IntegrationFlowDefinition}. */ public B channel(String messageChannelName) { return channel(new MessageChannelReference(messageChannelName)); }
String channelName = null; if (outputChannel instanceof MessageChannelReference) { channelName = ((MessageChannelReference) outputChannel).getName();
@Override public void onInit() throws Exception { List<Recipient> recipients = new ArrayList<Recipient>(this.recipients.size()); for (Tuple2<?, ?> recipient : this.recipients) { if (recipient.getT1() instanceof String) { recipients.add(new DslRecipient(new MessageChannelReference((String) recipient.getT1()), populateRecipientSelector(recipient.getT2()))); } else { recipients.add(new Recipient((MessageChannel) recipient.getT1(), populateRecipientSelector(recipient.getT2()))); } } setRecipients(recipients); this.recipients.clear(); super.onInit(); }
String channelBeanName = ((MessageChannelReference) component).getName(); if (!this.beanFactory.containsBean(channelBeanName)) { DirectChannel directChannel = new DirectChannel();
@Override public void onInit() throws Exception { List<Recipient> recipients = new ArrayList<Recipient>(this.recipients.size()); for (Tuple2<?, ?> recipient : this.recipients) { if (recipient.getT1() instanceof String) { recipients.add(new DslRecipient(new MessageChannelReference((String) recipient.getT1()), populateRecipientSelector(recipient.getT2()))); } else { recipients.add(new Recipient((MessageChannel) recipient.getT1(), populateRecipientSelector(recipient.getT2()))); } } setRecipients(recipients); this.recipients.clear(); super.onInit(); }