|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.MessageHandlerChain
public class MessageHandlerChain
A composite MessageHandler
implementation that invokes a chain of
MessageHandler instances in order.
Each of the handlers except for the last one must implement the
MessageProducer
interface. The last handler must also if
the chain itself has an output channel configured. No other assumptions
are made about the type of handler.
It is expected that each handler will produce reply messages and send them to
its output channel, although this is not enforced. It is possible to filter
messages in the middle of the chain, for example using a
MessageFilter
. A MessageHandler
returning null will have the
same effect, although this option is less expressive.
This component can be used from the namespace to improve the readability of the configuration by removing channels that can be created implicitly.
<chain> <filter ref="someFilter"/> <bean class="SomeMessageHandlerImplementation"/> <transformer ref="someTransformer"/> <aggregator ... /> </chain>
Field Summary |
---|
Fields inherited from class org.springframework.integration.handler.AbstractMessageHandler |
---|
logger |
Fields inherited from interface org.springframework.core.Ordered |
---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Constructor Summary | |
---|---|
MessageHandlerChain()
|
Method Summary | |
---|---|
java.lang.String |
getComponentType()
Subclasses may implement this method to provide component type information. |
int |
getOrder()
|
protected void |
handleMessageInternal(Message<?> message)
|
protected void |
onInit()
Subclasses may implement this for initialization logic. |
void |
setComponentName(java.lang.String componentName)
Sets the name of this component. |
void |
setHandlers(java.util.List<MessageHandler> handlers)
|
void |
setOrder(int order)
Set the order for this component. |
void |
setOutputChannel(MessageChannel outputChannel)
Specify the MessageChannel to which produced Messages should be sent. |
void |
setSendTimeout(long sendTimeout)
|
Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler |
---|
handleMessage, setShouldTrack |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setConversionService, setTaskScheduler, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.integration.context.NamedComponent |
---|
getComponentName |
Constructor Detail |
---|
public MessageHandlerChain()
Method Detail |
---|
public void setHandlers(java.util.List<MessageHandler> handlers)
public void setOutputChannel(MessageChannel outputChannel)
MessageProducer
setOutputChannel
in interface MessageProducer
public void setSendTimeout(long sendTimeout)
public void setOrder(int order)
Orderable
setOrder
in interface Orderable
setOrder
in class AbstractMessageHandler
public int getOrder()
getOrder
in interface Ordered
getOrder
in class AbstractMessageHandler
public java.lang.String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class AbstractMessageHandler
protected void onInit() throws java.lang.Exception
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
java.lang.Exception
protected void handleMessageInternal(Message<?> message) throws java.lang.Exception
handleMessageInternal
in class AbstractMessageHandler
java.lang.Exception
public void setComponentName(java.lang.String componentName)
IntegrationObjectSupport
setComponentName
in class IntegrationObjectSupport
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |