Skip to content
Snippets Groups Projects
Commit 45a51b49 authored by akwizgran's avatar akwizgran
Browse files

ExceptionHandler interface.

parent 0b749ca9
No related branches found
No related tags found
Loading
package net.sf.briar.api;
public interface ExceptionHandler<E extends Exception> {
void handleException(E exception);
}
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);
}
}
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment