Factored out the database cleaner.

This commit is contained in:
akwizgran
2011-07-04 18:11:27 +01:00
parent 390b316724
commit eb752ada62
9 changed files with 242 additions and 49 deletions

View File

@@ -41,12 +41,13 @@ class SynchronizedDatabaseComponent<Txn> extends DatabaseComponentImpl<Txn> {
private final Object subscriptionLock = new Object();
@Inject
SynchronizedDatabaseComponent(Database<Txn> db,
SynchronizedDatabaseComponent(Database<Txn> db, DatabaseCleaner cleaner,
Provider<Batch> batchProvider) {
super(db, batchProvider);
super(db, cleaner, batchProvider);
}
public void close() throws DbException {
cleaner.stopCleaning();
synchronized(contactLock) {
synchronized(messageLock) {
synchronized(messageStatusLock) {