Converted {Incoming,Outgoing}BatchConnection into Runnables.

Also changed the dispose() method of readers/writers/connections to
swallow any exceptions that occur, since the caller can't do anything
except log them.
This commit is contained in:
akwizgran
2011-10-14 16:14:29 +01:00
parent 55182528cf
commit d48c7b6900
14 changed files with 290 additions and 92 deletions

View File

@@ -1,6 +1,5 @@
package net.sf.briar.api.transport;
import java.io.IOException;
import java.io.InputStream;
/**
@@ -16,5 +15,5 @@ public interface BatchTransportReader {
* Closes the reader and disposes of any associated state. The argument
* should be false if an exception was thrown while using the reader.
*/
void dispose(boolean success) throws IOException;
void dispose(boolean success);
}

View File

@@ -1,6 +1,5 @@
package net.sf.briar.api.transport;
import java.io.IOException;
import java.io.OutputStream;
/**
@@ -19,5 +18,5 @@ public interface BatchTransportWriter {
* Closes the writer and disposes of any associated state. The argument
* should be false if an exception was thrown while using the writer.
*/
void dispose(boolean success) throws IOException;
void dispose(boolean success);
}

View File

@@ -21,5 +21,5 @@ public interface StreamTransportConnection {
* Closes the connection and disposes of any associated state. The argument
* should be false if an exception was thrown while using the connection.
*/
void dispose(boolean success) throws IOException;
void dispose(boolean success);
}

View File

@@ -0,0 +1,15 @@
package net.sf.briar.api.transport.batch;
import net.sf.briar.api.ContactId;
import net.sf.briar.api.TransportId;
import net.sf.briar.api.transport.BatchTransportReader;
import net.sf.briar.api.transport.BatchTransportWriter;
public interface BatchConnectionFactory {
Runnable createOutgoingConnection(TransportId t, ContactId c,
BatchTransportWriter w);
Runnable createIncomingConnection(ContactId c, BatchTransportReader r,
byte[] encryptedIv);
}