From: David ‘Bombe’ Roden Date: Wed, 26 Mar 2014 18:38:48 +0000 (+0100) Subject: Remove Service interface. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=af417cd58d0d99061ed484e981c7be20adf066d6;p=Sone.git Remove Service interface. --- diff --git a/src/main/java/net/pterodactylus/sone/database/Database.java b/src/main/java/net/pterodactylus/sone/database/Database.java index 02b4ae1..3fd7e2b 100644 --- a/src/main/java/net/pterodactylus/sone/database/Database.java +++ b/src/main/java/net/pterodactylus/sone/database/Database.java @@ -17,8 +17,6 @@ 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 @@ -26,6 +24,9 @@ import com.google.common.util.concurrent.Service; * * @author David ‘Bombe’ Roden */ -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(); } diff --git a/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java b/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java index a06fd5f..c49f978 100644 --- a/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java +++ b/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java @@ -60,7 +60,6 @@ import com.google.common.collect.ListMultimap; 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; /** @@ -68,7 +67,7 @@ import com.google.inject.Inject; * * @author David ‘Bombe’ Roden */ -public class MemoryDatabase extends AbstractService implements Database { +public class MemoryDatabase implements Database { private static final Logger logger = getLogger(MemoryDatabase.class.getName()); @@ -132,14 +131,14 @@ public class MemoryDatabase extends AbstractService implements Database { // @Override - protected void doStart() { + public void start() { memoryPostDatabase.start(); loadKnownPostReplies(); notifyStarted(); } @Override - protected void doStop() { + public void stop() { try { memoryPostDatabase.stop(); configuration.save();