Examples of BridgeHandler


Examples of org.springframework.integration.handler.BridgeHandler

      if (i > 0) {
        // first module MAY have 'input', all others MUST
        Assert.notNull(inputChannel, "each module after the first must provide 'input'");
      }
      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
View Full Code Here

Examples of org.springframework.integration.handler.BridgeHandler

  protected BridgeHandler bridge(String name, MessageChannel from, MessageChannel to, String bridgeName,
      final Collection<MediaType> acceptedMediaTypes, LocalBusPropertiesAccessor properties) {

    final boolean isInbound = bridgeName.startsWith("inbound.");

    BridgeHandler handler = new BridgeHandler() {

      @Override
      protected Object handleRequestMessage(Message<?> requestMessage) {
        return requestMessage;
      }

    };

    handler.setBeanFactory(getBeanFactory());
    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();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.