Merged transports' finish() and dispose() methods.

This commit is contained in:
akwizgran
2011-10-06 19:00:33 +01:00
parent 07d6715881
commit c08f6c4d1e
10 changed files with 29 additions and 65 deletions

View File

@@ -13,14 +13,8 @@ public interface BatchTransportReader {
InputStream getInputStream();
/**
* Finishes reading from the transport. This method should be called after
* closing the input stream.
* Closes the reader and disposes of any associated state. The argument
* should be false if an exception was thrown while using the reader.
*/
void finish() throws IOException;
/**
* Disposes of any associated state. This method must be called even if the
* reader is not used, or if an exception is thrown while using the reader.
*/
void dispose() throws IOException;
void dispose(boolean success) throws IOException;
}

View File

@@ -16,14 +16,8 @@ public interface BatchTransportWriter {
OutputStream getOutputStream();
/**
* Finishes writing to the transport. This method should be called after
* flushing and closing the output stream.
* Closes the writer and disposes of any associated state. The argument
* should be false if an exception was thrown while using the writer.
*/
void finish() throws IOException;
/**
* Disposes of any associated state. This method must be called even if the
* writer is not used, or if an exception is thrown while using the writer.
*/
void dispose() throws IOException;
void dispose(boolean success) throws IOException;
}

View File

@@ -18,15 +18,8 @@ public interface StreamTransportConnection {
OutputStream getOutputStream() throws IOException;
/**
* Finishes using the transport. This method should be called after closing
* the input and output streams.
* Closes the connection and disposes of any associated state. The argument
* should be false if an exception was thrown while using the connection.
*/
void finish() throws IOException;
/**
* Disposes of any associated state. This method must be called even if the
* connection is not used, or if an exception is thrown while using the
* connection.
*/
void dispose() throws IOException;
void dispose(boolean success) throws IOException;
}