Package org.springframework.integration.config

Examples of org.springframework.integration.config.ConsumerEndpointFactoryBean


    return gateway;
  }

  @Bean
  public ConsumerEndpointFactoryBean consumerEndpointFactoryBean() {
    ConsumerEndpointFactoryBean endpointFactoryBean = new ConsumerEndpointFactoryBean();
    endpointFactoryBean.setHandler(tcpOutboundGateway());
    endpointFactoryBean.setInputChannel(directChannel());
    return endpointFactoryBean;
  }
View Full Code Here


      if (previousOutputChannel != null) {
        BridgeHandler handler = new BridgeHandler();
        handler.setBeanFactory(this.context.getBeanFactory());
        handler.setOutputChannel(inputChannel);
        handler.afterPropertiesSet();
        ConsumerEndpointFactoryBean bridgeFactoryBean = new ConsumerEndpointFactoryBean();
        bridgeFactoryBean.setInputChannel(previousOutputChannel);
        bridgeFactoryBean.setHandler(handler);
        try {
          // TODO: might not be necessary to pass this context, but the FB requires non-null
          bridgeFactoryBean.setBeanFactory(this.context.getBeanFactory());
          bridgeFactoryBean.afterPropertiesSet();
          AbstractEndpoint endpoint = bridgeFactoryBean.getObject();
          endpoints.add(endpoint);
          this.context.getBeanFactory().registerSingleton("bridge-" + i, endpoint);
          endpoint.setComponentName("bridge-" + i);
          endpoint.afterPropertiesSet();
        }
View Full Code Here

    handler.setOutputChannel(to);
    handler.setBeanName(bridgeName);
    handler.afterPropertiesSet();

    // Usage of a CEFB allows to handle both Subscribable & Pollable channels the same way
    ConsumerEndpointFactoryBean cefb = new ConsumerEndpointFactoryBean();
    cefb.setInputChannel(from);
    cefb.setHandler(handler);
    cefb.setBeanFactory(getBeanFactory());
    if (from instanceof PollableChannel) {
      cefb.setPollerMetadata(poller);
    }
    try {
      cefb.afterPropertiesSet();
    }
    catch (Exception e) {
      throw new IllegalStateException(e);
    }

    try {
      cefb.getObject().setComponentName(handler.getComponentName());
      Binding binding = isInbound ? Binding.forConsumer(name, cefb.getObject(), to, properties)
          : Binding.forProducer(name, from, cefb.getObject(), properties);
      addBinding(binding);
      binding.start();
    }
    catch (Exception e) {
      throw new IllegalStateException(e);
View Full Code Here

TOP

Related Classes of org.springframework.integration.config.ConsumerEndpointFactoryBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.