/** * Configure an * {@link org.springframework.integration.handler.MethodInvokingMessageProcessor} that * invokes the method on the bean - the method must return a {@link Map} of headers. * They will be added to the inbound message headers before evaluating the individual * configured header specifications. * @param beanName The bean name. * @param methodName The method name. * @return the header enricher spec. * @see #messageProcessor(MessageProcessor) */ public HeaderEnricherSpec messageProcessor(String beanName, String methodName) { return messageProcessor(new BeanNameMessageProcessor<Object>(beanName, methodName)); }
/** * Populate the {@link MethodInvokingSplitter} to evaluate the provided * {@code method} of the {@code bean} at runtime. * In addition accept options for the integration endpoint using {@link GenericEndpointSpec}. * @param beanName the bean name to use. * @param methodName the method to invoke at runtime. * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options * and for {@link MethodInvokingSplitter}. * @return the current {@link IntegrationFlowDefinition}. * @see SplitterEndpointSpec */ public B split(String beanName, String methodName, Consumer<SplitterEndpointSpec<MethodInvokingSplitter>> endpointConfigurer) { return split(new MethodInvokingSplitter(new BeanNameMessageProcessor<Object>(beanName, methodName)), endpointConfigurer); }
/** * Configure an * {@link org.springframework.integration.handler.MethodInvokingMessageProcessor} that * invokes the method on the bean - the method must return a {@link Map} of headers. * They will be added to the inbound message headers before evaluating the individual * configured header specifications. * @param beanName The bean name. * @param methodName The method name. * @return the header enricher spec. * @see #messageProcessor(MessageProcessor) */ public HeaderEnricherSpec messageProcessor(String beanName, String methodName) { return messageProcessor(new BeanNameMessageProcessor<Object>(beanName, methodName)); }
/** * Populate a {@link ServiceActivatingHandler} for the * {@link org.springframework.integration.handler.MethodInvokingMessageProcessor} * to invoke the {@code method} for provided {@code bean} at runtime. * In addition accept options for the integration endpoint using {@link GenericEndpointSpec}. * @param beanName the bean name to use. * @param methodName the method to invoke. * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options. * @return the current {@link IntegrationFlowDefinition}. */ public B handle(String beanName, String methodName, Consumer<GenericEndpointSpec<ServiceActivatingHandler>> endpointConfigurer) { return handle(new ServiceActivatingHandler(new BeanNameMessageProcessor<Object>(beanName, methodName)), endpointConfigurer); }
/** * Populate the {@link MethodInvokingRouter} for provided bean and its method * with provided options from {@link RouterSpec}. * In addition accept options for the integration endpoint using {@link GenericEndpointSpec}. * @param beanName the bean to use. * @param method the method to invoke at runtime. * @param routerConfigurer the {@link Consumer} to provide {@link MethodInvokingRouter} options. * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options. * @return the current {@link IntegrationFlowDefinition}. */ public B route(String beanName, String method, Consumer<RouterSpec<Object, MethodInvokingRouter>> routerConfigurer, Consumer<GenericEndpointSpec<MethodInvokingRouter>> endpointConfigurer) { return this.route(new MethodInvokingRouter(new BeanNameMessageProcessor<Object>(beanName, method)), routerConfigurer, endpointConfigurer); }
/** * Populate the {@link MethodInvokingRouter} for provided bean and its method * with provided options from {@link RouterSpec}. * In addition accept options for the integration endpoint using {@link GenericEndpointSpec}. * @param beanName the bean to use. * @param method the method to invoke at runtime. * @param routerConfigurer the {@link Consumer} to provide {@link MethodInvokingRouter} options. * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options. * @return the current {@link IntegrationFlowDefinition}. */ public B route(String beanName, String method, Consumer<RouterSpec<Object, MethodInvokingRouter>> routerConfigurer, Consumer<GenericEndpointSpec<MethodInvokingRouter>> endpointConfigurer) { return this.route(new MethodInvokingRouter(new BeanNameMessageProcessor<Object>(beanName, method)), routerConfigurer, endpointConfigurer); }
/** * Populate a {@link ServiceActivatingHandler} for the * {@link org.springframework.integration.handler.MethodInvokingMessageProcessor} * to invoke the {@code method} for provided {@code bean} at runtime. * In addition accept options for the integration endpoint using {@link GenericEndpointSpec}. * @param beanName the bean name to use. * @param methodName the method to invoke. * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options. * @return the current {@link IntegrationFlowDefinition}. */ public B handle(String beanName, String methodName, Consumer<GenericEndpointSpec<ServiceActivatingHandler>> endpointConfigurer) { return handle(new ServiceActivatingHandler(new BeanNameMessageProcessor<Object>(beanName, methodName)), endpointConfigurer); }
/** * Populate the {@link MethodInvokingSplitter} to evaluate the provided * {@code method} of the {@code bean} at runtime. * In addition accept options for the integration endpoint using {@link GenericEndpointSpec}. * @param beanName the bean name to use. * @param methodName the method to invoke at runtime. * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options * and for {@link MethodInvokingSplitter}. * @return the current {@link IntegrationFlowDefinition}. * @see SplitterEndpointSpec */ public B split(String beanName, String methodName, Consumer<SplitterEndpointSpec<MethodInvokingSplitter>> endpointConfigurer) { return split(new MethodInvokingSplitter(new BeanNameMessageProcessor<Object>(beanName, methodName)), endpointConfigurer); }
/** * Populate a {@link ServiceActivatingHandler} instance to perform {@link MessageTriggerAction} * and endpoint options from {@link GenericEndpointSpec}. * @param triggerActionId the {@link MessageTriggerAction} bean id. * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options. * @return the current {@link IntegrationFlowDefinition}. * @since 1.2 */ public B trigger(String triggerActionId, Consumer<GenericEndpointSpec<ServiceActivatingHandler>> endpointConfigurer) { MessageProcessor<Void> trigger = new BeanNameMessageProcessor<Void>(triggerActionId, "trigger"); return handle(new ServiceActivatingHandler(trigger), endpointConfigurer); }
/** * Populate a {@link ServiceActivatingHandler} instance to perform {@link MessageTriggerAction} * and endpoint options from {@link GenericEndpointSpec}. * @param triggerActionId the {@link MessageTriggerAction} bean id. * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options. * @return the current {@link IntegrationFlowDefinition}. * @since 1.2 */ public B trigger(String triggerActionId, Consumer<GenericEndpointSpec<ServiceActivatingHandler>> endpointConfigurer) { MessageProcessor<Void> trigger = new BeanNameMessageProcessor<Void>(triggerActionId, "trigger"); return handle(new ServiceActivatingHandler(trigger), endpointConfigurer); }