Package org.springframework.ws.transport
Class AbstractWebServiceConnection
java.lang.Object
org.springframework.ws.transport.AbstractWebServiceConnection
- All Implemented Interfaces:
AutoCloseable
,WebServiceConnection
- Direct Known Subclasses:
AbstractReceiverConnection
,AbstractSenderConnection
Abstract base class for
WebServiceConnection
implementations.- Since:
- 1.0.0
- Author:
- Arjen Poutsma
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
close()
Closes this connection.protected abstract TransportInputStream
Returns aTransportInputStream
.protected abstract TransportOutputStream
Returns aTransportOutputStream
for the given message.protected void
onClose()
Template method invoked fromclose()
.protected void
onReceiveAfterRead
(WebServiceMessage message) Called when the given message has been read from theTransportInputStream
.protected void
Called before a message has been read from theTransportInputStream
.protected void
onSendAfterWrite
(WebServiceMessage message) Called after the given message has been written to theTransportOutputStream
.protected void
onSendBeforeWrite
(WebServiceMessage message) Called before the given message has been written to theTransportOutputStream
.final WebServiceMessage
receive
(WebServiceMessageFactory messageFactory) Receives a message using the givenWebServiceMessageFactory
.final void
send
(WebServiceMessage message) Sends the given message using this connection.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.ws.transport.WebServiceConnection
getErrorMessage, getUri, hasError
-
Constructor Details
-
AbstractWebServiceConnection
public AbstractWebServiceConnection()
-
-
Method Details
-
send
Description copied from interface:WebServiceConnection
Sends the given message using this connection.- Specified by:
send
in interfaceWebServiceConnection
- Parameters:
message
- the message to be sent- Throws:
IOException
- in case of I/O errors
-
onSendBeforeWrite
Called before the given message has been written to theTransportOutputStream
. Called fromsend(WebServiceMessage)
.Default implementation does nothing.
- Parameters:
message
- the message- Throws:
IOException
- when an I/O exception occurs
-
createTransportOutputStream
Returns aTransportOutputStream
for the given message. Called fromsend(WebServiceMessage)
.- Returns:
- the output stream
- Throws:
IOException
- when an I/O exception occurs
-
onSendAfterWrite
Called after the given message has been written to theTransportOutputStream
. Called fromsend(WebServiceMessage)
.Default implementation does nothing.
- Parameters:
message
- the message- Throws:
IOException
- when an I/O exception occurs
-
receive
Description copied from interface:WebServiceConnection
Receives a message using the givenWebServiceMessageFactory
. This method blocks until it receives, or returnsnull
when no message is received.- Specified by:
receive
in interfaceWebServiceConnection
- Parameters:
messageFactory
- the message factory used for reading messages- Returns:
- the read message, or
null
if no message received - Throws:
IOException
- in case of I/O errors
-
onReceiveBeforeRead
Called before a message has been read from theTransportInputStream
. Called fromreceive(WebServiceMessageFactory)
.Default implementation does nothing.
- Throws:
IOException
- when an I/O exception occurs
-
createTransportInputStream
Returns aTransportInputStream
. Called fromreceive(WebServiceMessageFactory)
.- Returns:
- the input stream, or
null
if no response can be read - Throws:
IOException
- when an I/O exception occurs
-
onReceiveAfterRead
Called when the given message has been read from theTransportInputStream
. Called fromreceive(WebServiceMessageFactory)
.Default implementation does nothing.
- Parameters:
message
- the message- Throws:
IOException
- when an I/O exception occurs
-
close
Description copied from interface:WebServiceConnection
Closes this connection.Once a connection has been closed, it is not available for further use. A new connection needs to be created.
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceWebServiceConnection
- Throws:
IOException
- if an I/O error occurs when closing this connection
-
onClose
Template method invoked fromclose()
. Default implementation is empty.- Throws:
IOException
- if an I/O error occurs when closing this connection
-