package net.pterodactylus.sone.database;
-import com.google.common.util.concurrent.Service;
-
/**
* Database for Sone data. This interface combines the various provider, store,
* and builder factory interfaces into a single interface and adds some methods
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
-public interface Database extends Service, IdentityDatabase, SoneDatabase, PostDatabase, PostReplyDatabase, AlbumDatabase, ImageDatabase {
+public interface Database extends IdentityDatabase, SoneDatabase, PostDatabase, PostReplyDatabase, AlbumDatabase, ImageDatabase {
+
+ void start();
+ void stop();
}
import com.google.common.collect.SetMultimap;
import com.google.common.collect.SortedSetMultimap;
import com.google.common.collect.TreeMultimap;
-import com.google.common.util.concurrent.AbstractService;
import com.google.inject.Inject;
/**
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
-public class MemoryDatabase extends AbstractService implements Database {
+public class MemoryDatabase implements Database {
private static final Logger logger = getLogger(MemoryDatabase.class.getName());
//
@Override
- protected void doStart() {
+ public void start() {
memoryPostDatabase.start();
loadKnownPostReplies();
notifyStarted();
}
@Override
- protected void doStop() {
+ public void stop() {
try {
memoryPostDatabase.stop();
configuration.save();