|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.context.IntegrationObjectSupport org.springframework.integration.endpoint.AbstractEndpoint org.springframework.integration.gateway.AbstractMessagingGateway
public abstract class AbstractMessagingGateway
A convenient base class for connecting application code to
MessageChannel
s for sending, receiving, or request-reply operations.
Exposes setters for configuring request and reply MessageChannel
s as
well as the timeout values for sending and receiving Messages.
Field Summary |
---|
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
logger |
Constructor Summary | |
---|---|
AbstractMessagingGateway()
|
Method Summary | |
---|---|
protected void |
doStart()
Subclasses must implement this method with the start behavior. |
protected void |
doStop()
Subclasses must implement this method with the stop behavior. |
protected abstract java.lang.Object |
fromMessage(Message<?> message)
Subclasses must implement this to map from a Message to an Object. |
protected void |
onInit()
|
java.lang.Object |
receive()
|
void |
send(java.lang.Object object)
|
java.lang.Object |
sendAndReceive(java.lang.Object object)
|
Message<?> |
sendAndReceiveMessage(java.lang.Object object)
|
void |
setReplyChannel(MessageChannel replyChannel)
Set the reply channel. |
void |
setReplyTimeout(long replyTimeout)
Set the timeout value for receiving reply messages. |
void |
setRequestChannel(MessageChannel requestChannel)
Set the request channel. |
void |
setRequestTimeout(long requestTimeout)
Set the timeout value for sending request messages. |
void |
setShouldThrowErrors(boolean shouldThrowErrors)
Specify whether the Throwable payload of a received ErrorMessage
should be extracted and thrown from a send-and-receive operation. |
protected abstract Message<?> |
toMessage(java.lang.Object object)
Subclasses must implement this to map from an Object to a Message. |
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint |
---|
afterPropertiesSet, isRunning, setAutoStartup, setTaskScheduler, start, stop |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
getBeanFactory, getBeanName, getChannelResolver, getTaskScheduler, setBeanFactory, setBeanName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractMessagingGateway()
Method Detail |
---|
public void setRequestChannel(MessageChannel requestChannel)
requestChannel
- the channel to which request messages will be sentpublic void setReplyChannel(MessageChannel replyChannel)
replyChannel
- the channel from which reply messages will be receivedpublic void setRequestTimeout(long requestTimeout)
requestTimeout
- the timeout value in millisecondspublic void setReplyTimeout(long replyTimeout)
replyTimeout
- the timeout value in millisecondspublic void setShouldThrowErrors(boolean shouldThrowErrors)
ErrorMessage
should be extracted and thrown from a send-and-receive operation.
Otherwise, the ErrorMessage would be returned just like any other
reply Message. The default is true
.
protected void onInit() throws java.lang.Exception
onInit
in class AbstractEndpoint
java.lang.Exception
public void send(java.lang.Object object)
send
in interface MessagingGateway
public java.lang.Object receive()
receive
in interface MessagingGateway
public java.lang.Object sendAndReceive(java.lang.Object object)
sendAndReceive
in interface MessagingGateway
public Message<?> sendAndReceiveMessage(java.lang.Object object)
sendAndReceiveMessage
in interface MessagingGateway
protected void doStart()
AbstractEndpoint
AbstractEndpoint.lifecycleLock
.
doStart
in class AbstractEndpoint
protected void doStop()
AbstractEndpoint
AbstractEndpoint.lifecycleLock
.
doStop
in class AbstractEndpoint
protected abstract Message<?> toMessage(java.lang.Object object)
protected abstract java.lang.Object fromMessage(Message<?> message)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |