ExceptionHandler interface.

This commit is contained in:
akwizgran
2011-12-06 10:58:26 +00:00
parent 0b749ca9e5
commit 45a51b4926
3 changed files with 10 additions and 5 deletions

View File

@@ -0,0 +1,6 @@
package net.sf.briar.api;
public interface ExceptionHandler<E extends Exception> {
void handleException(E exception);
}

View File

@@ -1,5 +1,6 @@
package net.sf.briar.api.transport;
import net.sf.briar.api.ExceptionHandler;
import net.sf.briar.api.db.DbException;
import net.sf.briar.api.protocol.TransportId;
@@ -15,12 +16,10 @@ public interface ConnectionRecogniser {
*/
void acceptConnection(TransportId t, byte[] tag, Callback c);
interface Callback {
interface Callback extends ExceptionHandler<DbException> {
void connectionAccepted(ConnectionContext ctx);
void connectionRejected();
void handleException(DbException e);
}
}

View File

@@ -58,7 +58,7 @@ class ConnectionDispatcherImpl implements ConnectionDispatcher {
}
public void connectionRejected() {
r.dispose(false);
r.dispose(true);
}
public void handleException(DbException e) {
@@ -103,7 +103,7 @@ class ConnectionDispatcherImpl implements ConnectionDispatcher {
}
public void connectionRejected() {
s.dispose(false);
s.dispose(true);
}
public void handleException(DbException e) {