Services should throw exceptions for startup errors.

This commit is contained in:
akwizgran
2016-04-05 15:44:50 +01:00
parent bbd14f1af4
commit b480777548
12 changed files with 87 additions and 85 deletions

View File

@@ -19,7 +19,6 @@ import org.briarproject.api.sync.MessageStatus;
import org.briarproject.api.sync.ValidationManager.Validity;
import org.briarproject.api.transport.TransportKeys;
import java.io.IOException;
import java.util.Collection;
import java.util.Map;
@@ -41,7 +40,7 @@ interface Database<T> {
* Prevents new transactions from starting, waits for all current
* transactions to finish, and closes the database.
*/
void close() throws DbException, IOException;
void close() throws DbException;
/**
* Starts a new transaction and returns an object representing it.

View File

@@ -50,7 +50,6 @@ import org.briarproject.api.sync.Request;
import org.briarproject.api.sync.ValidationManager.Validity;
import org.briarproject.api.transport.TransportKeys;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -101,9 +100,6 @@ class DatabaseComponentImpl<T> implements DatabaseComponent {
} catch (DbException e) {
if (LOG.isLoggable(WARNING))
LOG.log(WARNING, e.toString(), e);
} catch (IOException e) {
if (LOG.isLoggable(WARNING))
LOG.log(WARNING, e.toString(), e);
}
}
};
@@ -112,7 +108,7 @@ class DatabaseComponentImpl<T> implements DatabaseComponent {
return reopened;
}
public void close() throws DbException, IOException {
public void close() throws DbException {
if (closed.getAndSet(true)) return;
shutdown.removeShutdownHook(shutdownHandle);
db.close();