public abstract class CoLocatedMessageContext extends Object implements InboundTransportMessageContext, OutboundTransportMessageContext
Modifier and Type | Method and Description |
---|---|
void |
close(TransportOptions options)
Commits the contents of this context and clean up any resources used by this context.
|
TransportEndPoint |
getEndPoint() |
String |
getMessageId() |
RequestMetaData |
getRequestMetaData() |
Source |
getRequestPayload() |
ResponseMetaData |
getResponseMetaData() |
Source |
getResponsePayload()
client should not need to read the body of the response on the inbound message
|
URI |
getURI() |
void |
send(TransportSendListener listener) |
void |
setResponseMetaData(ResponseMetaData rmd)
Sets the meta-data for the response part of the message, e.g.
|
void |
setResponsePayload(Source src)
Sets the response payload into the message context Important note: the transport provider is free to access the response payload source from the moment this method call is made up all the way until
InboundTransportMessageContext.close(TransportOptions) is called. |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createResponseMetaData, createResponseMetaData
public URI getURI()
getURI
in interface TransportMessageContext
public TransportEndPoint getEndPoint()
getEndPoint
in interface InboundTransportMessageContext
public String getMessageId()
getMessageId
in interface TransportMessageContext
public RequestMetaData getRequestMetaData() throws TransportException
getRequestMetaData
in interface InboundTransportMessageContext
TransportException
public Source getRequestPayload() throws TransportException
getRequestPayload
in interface InboundTransportMessageContext
TransportException
public ResponseMetaData getResponseMetaData()
getResponseMetaData
in interface OutboundTransportMessageContext
public void setResponseMetaData(ResponseMetaData rmd) throws TransportException
InboundTransportMessageContext
setResponseMetaData
in interface InboundTransportMessageContext
rmd
- Transport Provider-specific POJO that represents response meta dataTransportException
public Source getResponsePayload() throws TransportException
getResponsePayload
in interface OutboundTransportMessageContext
TransportException
public void setResponsePayload(Source src) throws TransportException
InboundTransportMessageContext
InboundTransportMessageContext.close(TransportOptions)
is called. Any access of response payload source after close() has been called can lead to unpredictable results and is generally unsafe.setResponsePayload
in interface InboundTransportMessageContext
src
- source containing the response payloadTransportException
public void send(TransportSendListener listener) throws TransportException
TransportException
public void close(TransportOptions options)
InboundTransportMessageContext
close
in interface InboundTransportMessageContext
options
- specifies additional run-time parameters with respect to processing of inbound response. E.g. it can signal the mode of a given message: one-way versus request/response