|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.integration.channel.interceptor.ChannelInterceptorAdapter
org.springframework.batch.integration.chunk.MessageSourcePollerInterceptor
public class MessageSourcePollerInterceptor
A ChannelInterceptor that turns a pollable channel into a "pass-thru channel": if a client calls
receive() on the channel it will delegate to a MessageSource to pull the message directly from
an external source. This is particularly useful in combination with a message channel in thread scope, in which case
the receive() can join a transaction which was started by the caller.
| Constructor Summary | |
|---|---|
MessageSourcePollerInterceptor()
Convenient default constructor for configuration purposes. |
|
MessageSourcePollerInterceptor(org.springframework.integration.core.MessageSource<?> source)
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
Asserts that mandatory properties are set. |
boolean |
preReceive(org.springframework.integration.MessageChannel channel)
Receive from the MessageSource and send immediately to the input channel, so that the call that we are
intercepting always a message to receive. |
void |
setChannel(org.springframework.integration.MessageChannel channel)
Optional MessageChannel for injecting the message received from the source (defaults to the channel intercepted in preReceive(MessageChannel)). |
void |
setMessageSource(org.springframework.integration.core.MessageSource<?> source)
|
| Methods inherited from class org.springframework.integration.channel.interceptor.ChannelInterceptorAdapter |
|---|
postReceive, postSend, preSend |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MessageSourcePollerInterceptor()
public MessageSourcePollerInterceptor(org.springframework.integration.core.MessageSource<?> source)
source - a message source to poll for messages on receive.| Method Detail |
|---|
public void setChannel(org.springframework.integration.MessageChannel channel)
preReceive(MessageChannel)).
channel - the channel to set
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionInitializingBean.afterPropertiesSet()public void setMessageSource(org.springframework.integration.core.MessageSource<?> source)
source - a message source to poll for messages on receive.public boolean preReceive(org.springframework.integration.MessageChannel channel)
MessageSource and send immediately to the input channel, so that the call that we are
intercepting always a message to receive.
preReceive in interface org.springframework.integration.channel.ChannelInterceptorpreReceive in class org.springframework.integration.channel.interceptor.ChannelInterceptorAdapterChannelInterceptorAdapter.preReceive(MessageChannel)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||