/** * Populate an {@link org.springframework.integration.channel.FixedSubscriberChannel} instance * at the current {@link IntegrationFlow} chain position. * The provided {@code messageChannelName} is used for the bean registration. * @param messageChannelName the bean name to use. * @return the current {@link IntegrationFlowDefinition}. */ public B fixedSubscriberChannel(String messageChannelName) { return channel(new FixedSubscriberChannelPrototype(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()); }
@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. * Typically for the {@link org.springframework.integration.channel.FixedSubscriberChannel} together * with {@code fixedSubscriber = true}. * The {@link org.springframework.integration.dsl.IntegrationFlow} {@code inputChannel}. * @param messageChannelName the name for {@link DirectChannel} or * {@link org.springframework.integration.channel.FixedSubscriberChannel} * to be created on context startup, not reference. * The {@link MessageChannel} depends on the {@code fixedSubscriber} boolean argument. * @param fixedSubscriber the boolean flag to determine if result {@link MessageChannel} should * be {@link DirectChannel}, if {@code false} or * {@link org.springframework.integration.channel.FixedSubscriberChannel}, if {@code true}. * @return new {@link IntegrationFlowBuilder}. * @see DirectChannel * @see org.springframework.integration.channel.FixedSubscriberChannel */ public static IntegrationFlowBuilder from(String messageChannelName, boolean fixedSubscriber) { return fixedSubscriber ? from(new FixedSubscriberChannelPrototype(messageChannelName)) : from(messageChannelName); }
private <S extends ConsumerEndpointSpec<S, ? extends MessageHandler>> B register(S endpointSpec, Consumer<S> endpointConfigurer) { if (endpointConfigurer != null) { endpointConfigurer.accept(endpointSpec); } addComponents(endpointSpec.getComponentsToRegister()); MessageChannel inputChannel = this.currentMessageChannel; this.currentMessageChannel = null; if (inputChannel == null) { inputChannel = new DirectChannel(); this.registerOutputChannelIfCan(inputChannel); } Tuple2<ConsumerEndpointFactoryBean, ? extends MessageHandler> factoryBeanTuple2 = endpointSpec.get(); 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 an {@link org.springframework.integration.channel.FixedSubscriberChannel} instance * at the current {@link IntegrationFlow} chain position. * The provided {@code messageChannelName} is used for the bean registration. * @param messageChannelName the bean name to use. * @return the current {@link IntegrationFlowDefinition}. */ public B fixedSubscriberChannel(String messageChannelName) { return channel(new FixedSubscriberChannelPrototype(messageChannelName)); }
private <S extends ConsumerEndpointSpec<S, ? extends MessageHandler>> B register(S endpointSpec, Consumer<S> endpointConfigurer) { if (endpointConfigurer != null) { endpointConfigurer.accept(endpointSpec); } addComponents(endpointSpec.getComponentsToRegister()); MessageChannel inputChannel = this.currentMessageChannel; this.currentMessageChannel = null; if (inputChannel == null) { inputChannel = new DirectChannel(); this.registerOutputChannelIfCan(inputChannel); } Tuple2<ConsumerEndpointFactoryBean, ? extends MessageHandler> factoryBeanTuple2 = endpointSpec.get(); 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 an {@link org.springframework.integration.channel.FixedSubscriberChannel} instance * at the current {@link IntegrationFlow} chain position. * The provided {@code messageChannelName} is used for the bean registration. * @param messageChannelName the bean name to use. * @return the current {@link IntegrationFlowDefinition}. */ public B fixedSubscriberChannel(String messageChannelName) { return channel(new FixedSubscriberChannelPrototype(messageChannelName)); }
/** * Populate an {@link org.springframework.integration.channel.FixedSubscriberChannel} instance * at the current {@link IntegrationFlow} chain position. * The provided {@code messageChannelName} is used for the bean registration. * @param messageChannelName the bean name to use. * @return the current {@link IntegrationFlowDefinition}. */ public B fixedSubscriberChannel(String messageChannelName) { return channel(new FixedSubscriberChannelPrototype(messageChannelName)); }
/** * Populate the {@link MessageChannel} name to the new {@link IntegrationFlowBuilder} chain. * Typically for the {@link org.springframework.integration.channel.FixedSubscriberChannel} together * with {@code fixedSubscriber = true}. * The {@link org.springframework.integration.dsl.IntegrationFlow} {@code inputChannel}. * @param messageChannelName the name for {@link DirectChannel} or * {@link org.springframework.integration.channel.FixedSubscriberChannel} * to be created on context startup, not reference. * The {@link MessageChannel} depends on the {@code fixedSubscriber} boolean argument. * @param fixedSubscriber the boolean flag to determine if result {@link MessageChannel} should * be {@link DirectChannel}, if {@code false} or * {@link org.springframework.integration.channel.FixedSubscriberChannel}, if {@code true}. * @return new {@link IntegrationFlowBuilder}. * @see DirectChannel * @see org.springframework.integration.channel.FixedSubscriberChannel */ public static IntegrationFlowBuilder from(String messageChannelName, boolean fixedSubscriber) { return fixedSubscriber ? from(new FixedSubscriberChannelPrototype(messageChannelName)) : from(messageChannelName); }
/** * Populate the {@link MessageChannel} name to the new {@link IntegrationFlowBuilder} chain. * Typically for the {@link org.springframework.integration.channel.FixedSubscriberChannel} together * with {@code fixedSubscriber = true}. * The {@link org.springframework.integration.dsl.IntegrationFlow} {@code inputChannel}. * @param messageChannelName the name for {@link DirectChannel} or * {@link org.springframework.integration.channel.FixedSubscriberChannel} * to be created on context startup, not reference. * The {@link MessageChannel} depends on the {@code fixedSubscriber} boolean argument. * @param fixedSubscriber the boolean flag to determine if result {@link MessageChannel} should * be {@link DirectChannel}, if {@code false} or * {@link org.springframework.integration.channel.FixedSubscriberChannel}, if {@code true}. * @return new {@link IntegrationFlowBuilder}. * @see DirectChannel * @see org.springframework.integration.channel.FixedSubscriberChannel */ public static IntegrationFlowBuilder from(String messageChannelName, boolean fixedSubscriber) { return fixedSubscriber ? from(new FixedSubscriberChannelPrototype(messageChannelName)) : from(messageChannelName); }
/** * Populate the {@link MessageChannel} name to the new {@link IntegrationFlowBuilder} chain. * Typically for the {@link org.springframework.integration.channel.FixedSubscriberChannel} together * with {@code fixedSubscriber = true}. * The {@link org.springframework.integration.dsl.IntegrationFlow} {@code inputChannel}. * @param messageChannelName the name for {@link DirectChannel} or * {@link org.springframework.integration.channel.FixedSubscriberChannel} * to be created on context startup, not reference. * The {@link MessageChannel} depends on the {@code fixedSubscriber} boolean argument. * @param fixedSubscriber the boolean flag to determine if result {@link MessageChannel} should * be {@link DirectChannel}, if {@code false} or * {@link org.springframework.integration.channel.FixedSubscriberChannel}, if {@code true}. * @return new {@link IntegrationFlowBuilder}. * @see DirectChannel * @see org.springframework.integration.channel.FixedSubscriberChannel */ public static IntegrationFlowBuilder from(String messageChannelName, boolean fixedSubscriber) { return fixedSubscriber ? from(new FixedSubscriberChannelPrototype(messageChannelName)) : from(messageChannelName); }