public class GenericMessagingTemplate extends AbstractDestinationResolvingMessagingTemplate<MessageChannel> implements BeanFactoryAware
Modifier and Type | Class and Description |
---|---|
private static class |
GenericMessagingTemplate.TemporaryReplyChannel |
Modifier and Type | Field and Description |
---|---|
private long |
receiveTimeout |
private long |
sendTimeout |
private boolean |
throwExceptionOnLateReply |
logger
Constructor and Description |
---|
GenericMessagingTemplate() |
Modifier and Type | Method and Description |
---|---|
protected <P> Message<P> |
doReceive(MessageChannel destination) |
protected void |
doSend(MessageChannel destination,
Message<?> message) |
protected <S,R> Message<R> |
doSendAndReceive(MessageChannel destination,
Message<S> requestMessage) |
void |
setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
|
void |
setReceiveTimeout(long receiveTimeout)
Specify the timeout value to use for receive operations.
|
void |
setSendTimeout(long sendTimeout)
Specify the timeout value to use for send operations.
|
void |
setThrowExceptionOnLateReply(boolean throwExceptionOnLateReply)
Specify whether or not an attempt to send on the reply channel throws an exception
if no receiving thread will actually receive the reply.
|
convertAndSend, convertAndSend, convertSendAndReceive, convertSendAndReceive, receive, receiveAndConvert, resolveDestination, send, sendAndReceive, setDestinationResolver
convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, receive, receive, receiveAndConvert, receiveAndConvert, sendAndReceive, sendAndReceive
convertAndSend, convertAndSend, convertAndSend, convertAndSend, getConverter, getDefaultDestination, getRequiredDefaultDestination, send, send, setConverter, setDefaultDestination, setMessageConverter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convertAndSend, convertAndSend, convertAndSend, convertAndSend, send, send
receive, receive, receiveAndConvert, receiveAndConvert
convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, sendAndReceive, sendAndReceive
private volatile long sendTimeout
private volatile long receiveTimeout
private volatile boolean throwExceptionOnLateReply
public void setSendTimeout(long sendTimeout)
sendTimeout
- the send timeout in millisecondspublic void setReceiveTimeout(long receiveTimeout)
receiveTimeout
- the receive timeout in millisecondspublic void setThrowExceptionOnLateReply(boolean throwExceptionOnLateReply)
throwExceptionOnLateReply
- TRUE or FALSE.public void setBeanFactory(BeanFactory beanFactory) throws BeansException
BeanFactoryAware
Invoked after the population of normal bean properties
but before an initialization callback such as
InitializingBean.afterPropertiesSet()
or a custom init-method.
setBeanFactory
in interface BeanFactoryAware
beanFactory
- owning BeanFactory (never null
).
The bean can immediately call methods on the factory.BeansException
- in case of initialization errorsBeanInitializationException
protected final void doSend(MessageChannel destination, Message<?> message)
doSend
in class AbstractMessageSendingTemplate<MessageChannel>
protected final <P> Message<P> doReceive(MessageChannel destination)
doReceive
in class AbstractMessagingTemplate<MessageChannel>
protected final <S,R> Message<R> doSendAndReceive(MessageChannel destination, Message<S> requestMessage)
doSendAndReceive
in class AbstractMessagingTemplate<MessageChannel>