public class JmsSenderConnection extends AbstractSenderConnection
WebServiceConnection that is used for client-side JMS access. Exposes a BytesMessage request and response message.| Modifier | Constructor and Description |
|---|---|
protected |
JmsSenderConnection(ConnectionFactory connectionFactory,
Connection connection,
Session session,
Destination requestDestination,
Message requestMessage)
Constructs a new JMS connection with the given parameters.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addRequestHeader(String name,
String value)
Adds a request header with the given name and value.
|
String |
getErrorMessage()
Returns the error message.
|
Message |
getRequestMessage()
Returns the request message for this connection.
|
protected OutputStream |
getRequestOutputStream()
Returns the output stream to write the request to.
|
protected Iterator<String> |
getResponseHeaderNames()
Returns an iteration over all the header names this request contains.
|
protected Iterator<String> |
getResponseHeaders(String name)
Returns an iteration over all the string values of the specified header.
|
protected InputStream |
getResponseInputStream()
Returns the input stream to read the response from.
|
Message |
getResponseMessage()
Returns the response message, if any, for this connection.
|
URI |
getUri()
Returns the URI for this connection.
|
boolean |
hasError()
Indicates whether this connection has an error.
|
protected boolean |
hasResponse()
Indicates whether this connection has a response.
|
protected void |
onClose()
Template method invoked from
AbstractWebServiceConnection.close(). |
protected void |
onReceiveBeforeRead()
Called before a message has been read from the
TransportInputStream. |
protected void |
onSendAfterWrite(WebServiceMessage message)
Called after the given message has been written to the
TransportOutputStream. |
createTransportInputStream, createTransportOutputStreamclose, onReceiveAfterRead, onSendBeforeWrite, receive, sendprotected JmsSenderConnection(ConnectionFactory connectionFactory, Connection connection, Session session, Destination requestDestination, Message requestMessage) throws JMSException
JMSExceptionpublic Message getRequestMessage()
BytesMessage or a TextMessage.public Message getResponseMessage()
BytesMessage or a TextMessage.public URI getUri() throws URISyntaxException
WebServiceConnectionURISyntaxExceptionpublic boolean hasError()
throws IOException
WebServiceConnectiontrue if this connection has an error; false otherwise.IOExceptionpublic String getErrorMessage() throws IOException
WebServiceConnectionnull when no error is presentIOExceptionWebServiceConnection.hasError()protected void addRequestHeader(String name, String value) throws IOException
AbstractSenderConnectionaddRequestHeader in class AbstractSenderConnectionname - the name of the headervalue - the value of the headerIOExceptionprotected OutputStream getRequestOutputStream() throws IOException
AbstractSenderConnectiongetRequestOutputStream in class AbstractSenderConnectionIOExceptionprotected void onSendAfterWrite(WebServiceMessage message) throws IOException
AbstractWebServiceConnectionTransportOutputStream. Called from AbstractWebServiceConnection.send(WebServiceMessage).
Default implementation does nothing.
onSendAfterWrite in class AbstractWebServiceConnectionmessage - the messageIOException - when an I/O exception occursprotected void onReceiveBeforeRead()
throws IOException
AbstractWebServiceConnectionTransportInputStream. Called from AbstractWebServiceConnection.receive(WebServiceMessageFactory).
Default implementation does nothing.
onReceiveBeforeRead in class AbstractWebServiceConnectionIOException - when an I/O exception occursprotected boolean hasResponse()
throws IOException
AbstractSenderConnectionhasResponse in class AbstractSenderConnectionIOExceptionprotected Iterator<String> getResponseHeaderNames() throws IOException
AbstractSenderConnectionIterator if
there are no headers.getResponseHeaderNames in class AbstractSenderConnectionIOExceptionprotected Iterator<String> getResponseHeaders(String name) throws IOException
AbstractSenderConnectionIterator
if there are no headers of the specified name.getResponseHeaders in class AbstractSenderConnectionIOExceptionprotected InputStream getResponseInputStream() throws IOException
AbstractSenderConnectiongetResponseInputStream in class AbstractSenderConnectionIOExceptionprotected void onClose()
throws IOException
AbstractSenderConnectionAbstractWebServiceConnection.close(). Default implementation is empty.onClose in class AbstractSenderConnectionIOException - if an I/O error occurs when closing this connection