Added finish() methods to transport readers/writers, and added a

readerFinished() callback method to FilePlugin.
This commit is contained in:
akwizgran
2011-10-05 18:59:30 +01:00
parent 775d76d040
commit 80cba1e7f7
5 changed files with 33 additions and 8 deletions

View File

@@ -13,9 +13,14 @@ public interface BatchTransportReader {
InputStream getInputStream();
/**
* Closes the reader and 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.
* Finishes reading from the transport. This method should be called after
* closing the input stream.
*/
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;
}

View File

@@ -18,9 +18,15 @@ public interface StreamTransportConnection {
OutputStream getOutputStream() throws IOException;
/**
* Closes the connection and 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.
* Finishes using the transport. This method should be called after closing
* the input and output streams.
*/
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 close() throws IOException;
}