|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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.context.IntegrationObjectSupport |
---|
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 |
getPhase()
|
protected void |
handleMessageInternal(Message<?> message)
|
boolean |
isAutoStartup()
SmartLifecycle implementation (delegates to the handlers ) |
boolean |
isRunning()
|
protected void |
onInit()
Subclasses may implement this for initialization logic. |
void |
setAutoStartup(boolean autoStartup)
|
void |
setHandlers(java.util.List<MessageHandler> handlers)
|
void |
setOutputChannel(MessageChannel outputChannel)
Specify the MessageChannel to which produced Messages should be sent. |
void |
setPhase(int phase)
|
void |
setSendTimeout(long sendTimeout)
|
void |
start()
|
void |
stop()
|
void |
stop(java.lang.Runnable callback)
|
Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler |
---|
getOrder, handleMessage, setOrder, setShouldTrack |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, 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 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 final boolean isAutoStartup()
handlers
)
isAutoStartup
in interface org.springframework.context.SmartLifecycle
public final int getPhase()
getPhase
in interface org.springframework.context.Phased
public final boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public final void start()
start
in interface org.springframework.context.Lifecycle
public final void stop()
stop
in interface org.springframework.context.Lifecycle
public final void stop(java.lang.Runnable callback)
stop
in interface org.springframework.context.SmartLifecycle
public void setAutoStartup(boolean autoStartup)
public void setPhase(int phase)
|
Spring Integration | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |