private static IntegrationFlowBuilder from(MessageSource<?> messageSource, @Nullable Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer, @Nullable IntegrationFlowBuilder integrationFlowBuilderArg) { IntegrationFlowBuilder integrationFlowBuilder = integrationFlowBuilderArg; SourcePollingChannelAdapterSpec spec = new SourcePollingChannelAdapterSpec(messageSource); if (endpointConfigurer != null) { endpointConfigurer.accept(spec); } if (integrationFlowBuilder == null) { integrationFlowBuilder = new IntegrationFlowBuilder(); } return integrationFlowBuilder.addComponent(spec) .currentComponent(spec); }
private static IntegrationFlowBuilder from(MessageProducerSupport messageProducer, @Nullable IntegrationFlowBuilder integrationFlowBuilderArg) { IntegrationFlowBuilder integrationFlowBuilder = integrationFlowBuilderArg; MessageChannel outputChannel = messageProducer.getOutputChannel(); if (outputChannel == null) { outputChannel = new DirectChannel(); messageProducer.setOutputChannel(outputChannel); } if (integrationFlowBuilder == null) { integrationFlowBuilder = from(outputChannel); } else { integrationFlowBuilder.channel(outputChannel); } return integrationFlowBuilder.addComponent(messageProducer); }
private static IntegrationFlowBuilder from(MessagingGatewaySupport inboundGateway, @Nullable IntegrationFlowBuilder integrationFlowBuilderArg) { IntegrationFlowBuilder integrationFlowBuilder = integrationFlowBuilderArg; MessageChannel outputChannel = inboundGateway.getRequestChannel(); if (outputChannel == null) { outputChannel = new DirectChannel(); inboundGateway.setRequestChannel(outputChannel); } if (integrationFlowBuilder == null) { integrationFlowBuilder = from(outputChannel); } else { integrationFlowBuilder.channel(outputChannel); } return integrationFlowBuilder.addComponent(inboundGateway); }
/** * Populate the {@link MessageChannel} to the new {@link IntegrationFlowBuilder} * chain, which becomes as a {@code requestChannel} for the Messaging Gateway(s) built * on the provided service interface. * <p>A gateway proxy bean for provided service interface is registered under a name of * the provided {@code beanName} if not null, or from the * {@link org.springframework.integration.annotation.MessagingGateway#name()} if present * or as a fallback to the {@link IntegrationFlow} bean name plus {@code .gateway} suffix. * @param serviceInterface the service interface class with an optional * {@link org.springframework.integration.annotation.MessagingGateway} annotation. * @param beanName the bean name to be used for registering bean for the gateway proxy * @return new {@link IntegrationFlowBuilder}. */ public static IntegrationFlowBuilder from(Class<?> serviceInterface, @Nullable String beanName) { final DirectChannel gatewayRequestChannel = new DirectChannel(); GatewayProxyFactoryBean gatewayProxyFactoryBean = new AnnotationGatewayProxyFactoryBean(serviceInterface); gatewayProxyFactoryBean.setDefaultRequestChannel(gatewayRequestChannel); if (beanName != null) { gatewayProxyFactoryBean.setBeanName(beanName); } return from(gatewayRequestChannel) .addComponent(gatewayProxyFactoryBean); }
private static IntegrationFlowBuilder from(MessageSource<?> messageSource, @Nullable Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer, @Nullable IntegrationFlowBuilder integrationFlowBuilderArg) { IntegrationFlowBuilder integrationFlowBuilder = integrationFlowBuilderArg; SourcePollingChannelAdapterSpec spec = new SourcePollingChannelAdapterSpec(messageSource); if (endpointConfigurer != null) { endpointConfigurer.accept(spec); } if (integrationFlowBuilder == null) { integrationFlowBuilder = new IntegrationFlowBuilder(); } return integrationFlowBuilder.addComponent(spec) .currentComponent(spec); }
private static IntegrationFlowBuilder from(MessageSource<?> messageSource, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer, IntegrationFlowBuilder integrationFlowBuilder) { SourcePollingChannelAdapterSpec spec = new SourcePollingChannelAdapterSpec(messageSource); if (endpointConfigurer != null) { endpointConfigurer.accept(spec); } if (integrationFlowBuilder == null) { integrationFlowBuilder = new IntegrationFlowBuilder(); } return integrationFlowBuilder.addComponent(spec) .currentComponent(spec); }
private static IntegrationFlowBuilder from(MessageProducerSupport messageProducer, @Nullable IntegrationFlowBuilder integrationFlowBuilderArg) { IntegrationFlowBuilder integrationFlowBuilder = integrationFlowBuilderArg; MessageChannel outputChannel = messageProducer.getOutputChannel(); if (outputChannel == null) { outputChannel = new DirectChannel(); messageProducer.setOutputChannel(outputChannel); } if (integrationFlowBuilder == null) { integrationFlowBuilder = from(outputChannel); } else { integrationFlowBuilder.channel(outputChannel); } return integrationFlowBuilder.addComponent(messageProducer); }
private static IntegrationFlowBuilder from(MessagingGatewaySupport inboundGateway, @Nullable IntegrationFlowBuilder integrationFlowBuilderArg) { IntegrationFlowBuilder integrationFlowBuilder = integrationFlowBuilderArg; MessageChannel outputChannel = inboundGateway.getRequestChannel(); if (outputChannel == null) { outputChannel = new DirectChannel(); inboundGateway.setRequestChannel(outputChannel); } if (integrationFlowBuilder == null) { integrationFlowBuilder = from(outputChannel); } else { integrationFlowBuilder.channel(outputChannel); } return integrationFlowBuilder.addComponent(inboundGateway); }
private static IntegrationFlowBuilder from(MessageSource<?> messageSource, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer, IntegrationFlowBuilder integrationFlowBuilder) { SourcePollingChannelAdapterSpec spec = new SourcePollingChannelAdapterSpec(messageSource); if (endpointConfigurer != null) { endpointConfigurer.accept(spec); } if (integrationFlowBuilder == null) { integrationFlowBuilder = new IntegrationFlowBuilder(); } return integrationFlowBuilder.addComponent(spec) .currentComponent(spec); }
/** * Populate the {@link MessageChannel} to the new {@link IntegrationFlowBuilder} * chain, which becomes as a {@code requestChannel} for the Messaging Gateway(s) built * on the provided service interface. * <p>A gateway proxy bean for provided service interface is registered under a name of * the provided {@code beanName} if not null, or from the * {@link org.springframework.integration.annotation.MessagingGateway#name()} if present * or as a fallback to the {@link IntegrationFlow} bean name plus {@code .gateway} suffix. * @param serviceInterface the service interface class with an optional * {@link org.springframework.integration.annotation.MessagingGateway} annotation. * @param beanName the bean name to be used for registering bean for the gateway proxy * @return new {@link IntegrationFlowBuilder}. */ public static IntegrationFlowBuilder from(Class<?> serviceInterface, @Nullable String beanName) { final DirectChannel gatewayRequestChannel = new DirectChannel(); GatewayProxyFactoryBean gatewayProxyFactoryBean = new AnnotationGatewayProxyFactoryBean(serviceInterface); gatewayProxyFactoryBean.setDefaultRequestChannel(gatewayRequestChannel); if (beanName != null) { gatewayProxyFactoryBean.setBeanName(beanName); } return from(gatewayRequestChannel) .addComponent(gatewayProxyFactoryBean); }
private static IntegrationFlowBuilder from(MessageProducerSupport messageProducer, IntegrationFlowBuilder integrationFlowBuilder) { MessageChannel outputChannel = messageProducer.getOutputChannel(); if (outputChannel == null) { outputChannel = new DirectChannel(); messageProducer.setOutputChannel(outputChannel); } if (integrationFlowBuilder == null) { integrationFlowBuilder = from(outputChannel); } else { integrationFlowBuilder.channel(outputChannel); } return integrationFlowBuilder.addComponent(messageProducer); }
private static IntegrationFlowBuilder from(MessagingGatewaySupport inboundGateway, IntegrationFlowBuilder integrationFlowBuilder) { MessageChannel outputChannel = inboundGateway.getRequestChannel(); if (outputChannel == null) { outputChannel = new DirectChannel(); inboundGateway.setRequestChannel(outputChannel); } if (integrationFlowBuilder == null) { integrationFlowBuilder = from(outputChannel); } else { integrationFlowBuilder.channel(outputChannel); } return integrationFlowBuilder.addComponent(inboundGateway); }
private static IntegrationFlowBuilder from(MessagingGatewaySupport inboundGateway, IntegrationFlowBuilder integrationFlowBuilder) { MessageChannel outputChannel = inboundGateway.getRequestChannel(); if (outputChannel == null) { outputChannel = new DirectChannel(); inboundGateway.setRequestChannel(outputChannel); } if (integrationFlowBuilder == null) { integrationFlowBuilder = from(outputChannel); } else { integrationFlowBuilder.channel(outputChannel); } return integrationFlowBuilder.addComponent(inboundGateway); }
private static IntegrationFlowBuilder from(MessageProducerSupport messageProducer, IntegrationFlowBuilder integrationFlowBuilder) { MessageChannel outputChannel = messageProducer.getOutputChannel(); if (outputChannel == null) { outputChannel = new DirectChannel(); messageProducer.setOutputChannel(outputChannel); } if (integrationFlowBuilder == null) { integrationFlowBuilder = from(outputChannel); } else { integrationFlowBuilder.channel(outputChannel); } return integrationFlowBuilder.addComponent(messageProducer); }