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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()Closes this connection.protected abstract TransportInputStreamReturns aTransportInputStream.protected abstract TransportOutputStreamReturns aTransportOutputStreamfor the given message.protected voidonClose()Template method invoked fromclose().protected voidonReceiveAfterRead(WebServiceMessage message) Called when the given message has been read from theTransportInputStream.protected voidCalled before a message has been read from theTransportInputStream.protected voidonSendAfterWrite(WebServiceMessage message) Called after the given message has been written to theTransportOutputStream.protected voidonSendBeforeWrite(WebServiceMessage message) Called before the given message has been written to theTransportOutputStream.final WebServiceMessagereceive(WebServiceMessageFactory messageFactory) Receives a message using the givenWebServiceMessageFactory.final voidsend(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, waitMethods inherited from interface org.springframework.ws.transport.WebServiceConnection
getErrorMessage, getUri, hasError
-
Constructor Details
-
AbstractWebServiceConnection
public AbstractWebServiceConnection()
-
-
Method Details
-
send
Description copied from interface:WebServiceConnectionSends the given message using this connection.- Specified by:
sendin 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 aTransportOutputStreamfor 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:WebServiceConnectionReceives a message using the givenWebServiceMessageFactory. This method blocks until it receives, or returnsnullwhen no message is received.- Specified by:
receivein interfaceWebServiceConnection- Parameters:
messageFactory- the message factory used for reading messages- Returns:
- the read message, or
nullif 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
nullif 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:WebServiceConnectionCloses this connection.Once a connection has been closed, it is not available for further use. A new connection needs to be created.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein 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
-