/** * Populate the {@code Control Bus} EI Pattern specific {@link MessageHandler} implementation * at the current {@link IntegrationFlow} chain position. * @param endpointConfigurer the {@link Consumer} to accept integration endpoint options. * @return the current {@link IntegrationFlowDefinition}. * @see ExpressionCommandMessageProcessor * @see GenericEndpointSpec */ public B controlBus(Consumer<GenericEndpointSpec<ServiceActivatingHandler>> endpointConfigurer) { return handle(new ServiceActivatingHandler(new ExpressionCommandMessageProcessor( new ControlBusMethodFilter())), endpointConfigurer); }
/** * Evaluates the Message payload expression as a command. * @throws IllegalArgumentException if the payload is not an Exception or String */ @Override public Object processMessage(Message<?> message) { Object expression = message.getPayload(); if (expression instanceof Expression) { return evaluateExpression((Expression) expression, message); } if (expression instanceof String) { return evaluateExpression((String) expression, message); } throw new IllegalArgumentException("Message payload must be an Expression instance or an expression String."); }
public ExpressionCommandMessageProcessor(MethodFilter methodFilter, BeanFactory beanFactory) { if (beanFactory != null) { this.setBeanFactory(beanFactory); } if (methodFilter != null) { MethodResolver methodResolver = new ExpressionCommandMethodResolver(methodFilter); this.getEvaluationContext(false).setMethodResolvers(Collections.singletonList(methodResolver)); } }
@Override protected MessageHandler createHandler() { ExpressionCommandMessageProcessor processor = new ExpressionCommandMessageProcessor(methodFilter, this.getBeanFactory()); ServiceActivatingHandler handler = new ServiceActivatingHandler(processor); if (this.sendTimeout != null) { handler.setSendTimeout(this.sendTimeout); } return handler; }
public ExpressionCommandMessageProcessor(MethodFilter methodFilter, BeanFactory beanFactory) { if (beanFactory != null) { this.setBeanFactory(beanFactory); } if (methodFilter != null) { MethodResolver methodResolver = new ExpressionCommandMethodResolver(methodFilter); this.getEvaluationContext(false).setMethodResolvers(Collections.singletonList(methodResolver)); } }
/** * Evaluates the Message payload expression as a command. * @throws IllegalArgumentException if the payload is not an Exception or String */ @Override public Object processMessage(Message<?> message) { Object expression = message.getPayload(); if (expression instanceof Expression) { return evaluateExpression((Expression) expression, message); } if (expression instanceof String) { return evaluateExpression((String) expression, message); } throw new IllegalArgumentException("Message payload must be an Expression instance or an expression String."); }
/** * Populate the {@code Control Bus} EI Pattern specific {@link MessageHandler} implementation * at the current {@link IntegrationFlow} chain position. * @param endpointConfigurer the {@link Consumer} to accept integration endpoint options. * @return the current {@link IntegrationFlowDefinition}. * @see ExpressionCommandMessageProcessor * @see GenericEndpointSpec */ public B controlBus(Consumer<GenericEndpointSpec<ServiceActivatingHandler>> endpointConfigurer) { return this.handle(new ServiceActivatingHandler(new ExpressionCommandMessageProcessor( new ControlBusMethodFilter())), endpointConfigurer); }
/** * Populate the {@code Control Bus} EI Pattern specific {@link MessageHandler} implementation * at the current {@link IntegrationFlow} chain position. * @param endpointConfigurer the {@link Consumer} to accept integration endpoint options. * @return the current {@link IntegrationFlowDefinition}. * @see ExpressionCommandMessageProcessor * @see GenericEndpointSpec */ public B controlBus(Consumer<GenericEndpointSpec<ServiceActivatingHandler>> endpointConfigurer) { return handle(new ServiceActivatingHandler(new ExpressionCommandMessageProcessor( new ControlBusMethodFilter())), endpointConfigurer); }
/** * Populate the {@code Control Bus} EI Pattern specific {@link MessageHandler} implementation * at the current {@link IntegrationFlow} chain position. * @param endpointConfigurer the {@link Consumer} to accept integration endpoint options. * @return the current {@link IntegrationFlowDefinition}. * @see ExpressionCommandMessageProcessor * @see GenericEndpointSpec */ public B controlBus(Consumer<GenericEndpointSpec<ServiceActivatingHandler>> endpointConfigurer) { return this.handle(new ServiceActivatingHandler(new ExpressionCommandMessageProcessor( new ControlBusMethodFilter())), endpointConfigurer); }
@Override protected MessageHandler createHandler() { ExpressionCommandMessageProcessor processor = new ExpressionCommandMessageProcessor(methodFilter, this.getBeanFactory()); ServiceActivatingHandler handler = new ServiceActivatingHandler(processor); if (this.sendTimeout != null) { handler.setSendTimeout(this.sendTimeout); } return handler; }