|
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.endpoint.AbstractEndpoint org.springframework.integration.gateway.MessagingGatewaySupport
public abstract class MessagingGatewaySupport
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 | |
---|---|
MessagingGatewaySupport()
|
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. |
String |
getComponentType()
Subclasses may implement this method to provide component type information. |
protected void |
onInit()
Subclasses may implement this for initialization logic. |
protected Object |
receive()
|
protected void |
send(Object object)
|
protected Object |
sendAndReceive(Object object)
|
protected Message<?> |
sendAndReceiveMessage(Object object)
|
void |
setExceptionMapper(InboundMessageMapper<Throwable> exceptionMapper)
Provide an InboundMessageMapper for creating a reply Message from
an Exception that occurs downstream from this gateway. |
void |
setReplyChannel(MessageChannel replyChannel)
Set the reply channel. |
void |
setReplyMapper(OutboundMessageMapper<?> replyMapper)
Provide an OutboundMessageMapper for mapping to objects from
any reply Messages received in receive or sendAndReceive operations. |
void |
setReplyTimeout(long replyTimeout)
Set the timeout value for receiving reply messages. |
void |
setRequestChannel(MessageChannel requestChannel)
Set the request channel. |
void |
setRequestMapper(InboundMessageMapper<?> requestMapper)
Provide an InboundMessageMapper for creating request Messages
from any object passed in a send or sendAndReceive operation. |
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. |
void |
setShouldTrack(boolean shouldTrack)
Specify whether this gateway should be tracked in the Message History of Messages that originate from its send or sendAndReceive operations. |
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint |
---|
getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getRequiredMetadataPersister, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, 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 MessagingGatewaySupport()
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 setRequestMapper(InboundMessageMapper<?> requestMapper)
InboundMessageMapper
for creating request Messages
from any object passed in a send or sendAndReceive operation.
public void setReplyMapper(OutboundMessageMapper<?> replyMapper)
OutboundMessageMapper
for mapping to objects from
any reply Messages received in receive or sendAndReceive operations.
public void setExceptionMapper(InboundMessageMapper<Throwable> exceptionMapper)
InboundMessageMapper
for creating a reply Message from
an Exception that occurs downstream from this gateway. If no exceptionMapper
is provided, then the shouldThrowErrors
property will dictate
whether the error is rethrown or returned as an ErrorMessage.
public 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
.
public void setShouldTrack(boolean shouldTrack)
setShouldTrack
in interface TrackableComponent
public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport
protected void onInit() throws Exception
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
Exception
protected void send(Object object)
protected Object receive()
protected Object sendAndReceive(Object object)
protected Message<?> sendAndReceiveMessage(Object object)
protected void doStart()
AbstractEndpoint
AbstractEndpoint.lifecycleLock
.
doStart
in class AbstractEndpoint
protected void doStop()
AbstractEndpoint
AbstractEndpoint.lifecycleLock
.
doStop
in class AbstractEndpoint
|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |