|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.integration.dispatcher.PollingDispatcher
public class PollingDispatcher
Field Summary | |
---|---|
static long |
DEFAULT_RECEIVE_TIMEOUT
|
private MessageDispatcher |
dispatcher
|
private org.apache.commons.logging.Log |
logger
|
static int |
MAX_MESSAGES_UNBOUNDED
|
private int |
maxMessagesPerPoll
|
private MessageExchangeTemplate |
messageExchangeTemplate
|
private Schedule |
schedule
|
private PollableSource<?> |
source
|
Constructor Summary | |
---|---|
PollingDispatcher(PollableSource<?> source,
Schedule schedule)
Create a PollingDispatcher for the provided PollableSource . |
|
PollingDispatcher(PollableSource<?> source,
Schedule schedule,
MessageDispatcher dispatcher)
|
|
PollingDispatcher(PollableSource<?> source,
Schedule schedule,
MessageDispatcher dispatcher,
MessageExchangeTemplate messageExchangeTemplate)
|
Method Summary | |
---|---|
private MessageExchangeTemplate |
createDefaultTemplate()
|
Schedule |
getSchedule()
|
void |
run()
|
void |
setMaxMessagesPerPoll(int maxMessagesPerPoll)
Set the maximum number of messages to receive for each poll. |
void |
setReceiveTimeout(long receiveTimeout)
Specify the timeout to use when receiving from the source (in milliseconds). |
void |
setSendTimeout(long sendTimeout)
Specify the timeout to use when sending to a target (in milliseconds). |
boolean |
subscribe(MessageTarget target)
Register a MessageTarget as a subscriber to this source. |
java.lang.String |
toString()
|
boolean |
unsubscribe(MessageTarget target)
Remove a MessageTarget from the subscribers of this source. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MAX_MESSAGES_UNBOUNDED
public static final long DEFAULT_RECEIVE_TIMEOUT
private final org.apache.commons.logging.Log logger
private final PollableSource<?> source
private final MessageDispatcher dispatcher
private final Schedule schedule
private final MessageExchangeTemplate messageExchangeTemplate
private volatile int maxMessagesPerPoll
Constructor Detail |
---|
public PollingDispatcher(PollableSource<?> source, Schedule schedule)
PollableSource
.
It can be scheduled according to the specified Schedule
.
public PollingDispatcher(PollableSource<?> source, Schedule schedule, MessageDispatcher dispatcher)
public PollingDispatcher(PollableSource<?> source, Schedule schedule, MessageDispatcher dispatcher, MessageExchangeTemplate messageExchangeTemplate)
Method Detail |
---|
public void setReceiveTimeout(long receiveTimeout)
BlockingSource
.
A negative value indicates that receive calls should block indefinitely,
and that is the default behavior.
public void setSendTimeout(long sendTimeout)
BlockingTarget
.
public void setMaxMessagesPerPoll(int maxMessagesPerPoll)
The default is unbounded.
MAX_MESSAGES_UNBOUNDED
public boolean subscribe(MessageTarget target)
SubscribableSource
MessageTarget
as a subscriber to this source.
subscribe
in interface SubscribableSource
public boolean unsubscribe(MessageTarget target)
SubscribableSource
MessageTarget
from the subscribers of this source.
unsubscribe
in interface SubscribableSource
public Schedule getSchedule()
getSchedule
in interface SchedulableTask
public void run()
run
in interface java.lang.Runnable
public java.lang.String toString()
toString
in class java.lang.Object
private MessageExchangeTemplate createDefaultTemplate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |