Plugins may dispose of resources differently depending on whether a

connection was recognised.
This commit is contained in:
akwizgran
2011-12-08 18:56:53 +00:00
parent 0fdc69ff00
commit 844ae8f0a7
18 changed files with 97 additions and 74 deletions

View File

@@ -12,8 +12,10 @@ public interface BatchTransportReader {
InputStream getInputStream();
/**
* Closes the reader and disposes of any associated state. The argument
* should be false if an exception was thrown while using the reader.
* Closes the reader and disposes of any associated resources. The first
* argument indicates whether the reader is being closed because of an
* exception and the second argument indicates whether the connection was
* recognised, which may affect how resources are disposed of.
*/
void dispose(boolean success);
void dispose(boolean exception, boolean recognised);
}

View File

@@ -15,8 +15,9 @@ public interface BatchTransportWriter {
OutputStream getOutputStream();
/**
* Closes the writer and disposes of any associated state. The argument
* should be false if an exception was thrown while using the writer.
* Closes the writer and disposes of any associated resources. The
* argument indicates whether the writer is being closed because of an
* exception, which may affect how resources are disposed of.
*/
void dispose(boolean success);
void dispose(boolean exception);
}

View File

@@ -18,8 +18,10 @@ public interface StreamTransportConnection {
OutputStream getOutputStream() throws IOException;
/**
* Closes the connection and disposes of any associated state. The argument
* should be false if an exception was thrown while using the connection.
* Closes the connection and disposes of any associated resources. The
* first argument indicates whether the connection is being closed because
* of an exception and the second argument indicates whether the connection
* was recognised, which may affect how resources are disposed of.
*/
void dispose(boolean success);
void dispose(boolean exception, boolean recognised);
}