org.springframework.integration.handler
Class AbstractMessageHandler
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.AbstractMessageHandler
- All Implemented Interfaces:
- BeanFactoryAware, BeanNameAware, InitializingBean, Ordered, MessageHandler, NamedComponent
- Direct Known Subclasses:
- AbstractMessageRouter, AbstractReplyProducingMessageHandler, ApplicationEventPublishingMessageHandler, CorrelatingMessageBarrier, CorrelatingMessageHandler, LoggingHandler, NotificationPublishingMessageHandler
public abstract class AbstractMessageHandler
- extends IntegrationObjectSupport
- implements MessageHandler, Ordered
Base class for MessageHandler implementations that provides basic
validation and error handling capabilities. Asserts that the incoming
Message is not null and that it does not contain a null payload. Converts
checked exceptions into runtime MessagingException
s.
- Author:
- Mark Fisher, Oleg Zhurakousky
Field Summary |
protected org.apache.commons.logging.Log |
logger
|
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
afterPropertiesSet, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getTaskScheduler, onInit, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setTaskScheduler, toString, writeMessageHistory |
logger
protected final org.apache.commons.logging.Log logger
AbstractMessageHandler
public AbstractMessageHandler()
setOrder
public void setOrder(int order)
getOrder
public int getOrder()
- Specified by:
getOrder
in interface Ordered
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 IntegrationObjectSupport
handleMessage
public final void handleMessage(Message<?> message)
- Description copied from interface:
MessageHandler
- Handles the message if possible. If the handler cannot deal with the
message this will result in a
MessageRejectedException
e.g.
in case of a Selective Consumer. When a consumer tries to handle a
message, but fails to do so, a MessageHandlingException
is
thrown. In the last case it is recommended to treat the message as tainted
and go into an error scenario.
When the handling results in a message being sent failure to send that
message will result in a MessageDeliveryException
.
- Specified by:
handleMessage
in interface MessageHandler
- Parameters:
message
- the message to be handled
handleMessageInternal
protected abstract void handleMessageInternal(Message<?> message)
throws Exception
- Throws:
Exception
resolveReplyChannel
protected final MessageChannel resolveReplyChannel(Message<?> requestMessage,
MessageChannel defaultOutputChannel)
Copyright © 2010. All Rights Reserved.