Spring Integration

org.springframework.integration.handler
Class BridgeHandler

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.handler.AbstractMessageHandler
          extended by org.springframework.integration.handler.AbstractReplyProducingMessageHandler
              extended by org.springframework.integration.handler.BridgeHandler
All Implemented Interfaces:
BeanFactoryAware, BeanNameAware, InitializingBean, Ordered, MessageHandler, MessageProducer, NamedComponent

public class BridgeHandler
extends AbstractReplyProducingMessageHandler

A simple MessageHandler implementation that passes the request Message directly to the output channel without modifying it. The main purpose of this handler is to bridge a PollableChannel to a SubscribableChannel or vice-versa.

The BridgeHandler can be used as a stopper at the end of an assembly line of channels. In this setup the output channel doesn't have to be set, but if the output channel is omitted the REPLY_CHANNEL MUST be set on the message.

Author:
Mark Fisher, Iwein Fuld

Field Summary
 
Fields inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandler
DEFAULT_SEND_TIMEOUT
 
Fields inherited from class org.springframework.integration.handler.AbstractMessageHandler
logger
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
BridgeHandler()
           
 
Method Summary
 String getComponentType()
          Subclasses may implement this method to provide component type information.
protected  Object handleRequestMessage(Message<?> requestMessage)
          Subclasses must implement this method to handle the request Message.
 
Methods inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandler
getOutputChannel, handleMessageInternal, handleResult, sendReplyMessage, setChannelResolver, setOutputChannel, setRequiresReply, setSendTimeout
 
Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler
getOrder, handleMessage, resolveReplyChannel, setOrder
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getTaskScheduler, onInit, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString, writeMessageHistory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BridgeHandler

public BridgeHandler()
Method Detail

getComponentType

public String getComponentType()
Description copied from class: IntegrationObjectSupport
Subclasses may implement this method to provide component type information.

Specified by:
getComponentType in interface NamedComponent
Overrides:
getComponentType in class AbstractMessageHandler

handleRequestMessage

protected Object handleRequestMessage(Message<?> requestMessage)
Description copied from class: AbstractReplyProducingMessageHandler
Subclasses must implement this method to handle the request Message. The return value may be a Message, a MessageBuilder, or any plain Object. The base class will handle the final creation of a reply Message from any of those starting points. If the return value is null, the Message flow will end here.

Specified by:
handleRequestMessage in class AbstractReplyProducingMessageHandler

Spring Integration

Copyright © 2010. All Rights Reserved.