Refactored transport component and renamed WritersModule.

The goal of the refactoring was to clean up the dependencies of
IncomingBatchConnection and OutgoingBatchConnection.
This commit is contained in:
akwizgran
2011-09-27 19:21:44 +01:00
parent 6ed8d89e59
commit 4aff0c4f88
21 changed files with 105 additions and 161 deletions

View File

@@ -11,10 +11,6 @@ public interface ConnectionWriter {
*/
OutputStream getOutputStream();
/**
* Returns the number of bytes that can be written to this writer without
* outputting more than the given number of bytes, including encryption and
* authentication overhead.
*/
long getCapacity(long capacity);
/** Returns the maximum number of bytes that can be written. */
long getCapacity();
}

View File

@@ -4,6 +4,7 @@ import java.io.OutputStream;
public interface ConnectionWriterFactory {
ConnectionWriter createConnectionWriter(OutputStream out, boolean initiator,
int transportId, long connection, byte[] secret);
ConnectionWriter createConnectionWriter(OutputStream out,
long capacity, boolean initiator, int transportId, long connection,
byte[] secret);
}

View File

@@ -10,7 +10,7 @@ import java.io.InputStream;
public interface BatchTransportReader {
/** Returns an input stream for reading from the transport. */
InputStream getInputStream() throws IOException;
InputStream getInputStream();
/**
* Closes the reader and disposes of any associated state. This method must

View File

@@ -10,10 +10,10 @@ import java.io.OutputStream;
public interface BatchTransportWriter {
/** Returns the maximum number of bytes that can be written. */
long getCapacity() throws IOException;
long getCapacity();
/** Returns an output stream for writing to the transport. */
OutputStream getOutputStream() throws IOException;
OutputStream getOutputStream();
/**
* Closes the writer and disposes of any associated state. This method must