Remove unused code.
[Sone.git] / src / main / java / net / pterodactylus / sone / main / SonePlugin.java
index 1080818..ef7f750 100644 (file)
@@ -25,8 +25,9 @@ import java.util.logging.Logger;
 import net.pterodactylus.sone.core.Core;
 import net.pterodactylus.sone.core.FreenetInterface;
 import net.pterodactylus.sone.core.WebOfTrustUpdater;
-import net.pterodactylus.sone.data.PostBuilderFactory;
-import net.pterodactylus.sone.data.impl.DefaultPostBuilderFactory;
+import net.pterodactylus.sone.database.Database;
+import net.pterodactylus.sone.database.SoneProvider;
+import net.pterodactylus.sone.database.memory.MemoryDatabase;
 import net.pterodactylus.sone.fcp.FcpInterface;
 import net.pterodactylus.sone.freenet.PluginStoreConfigurationBackend;
 import net.pterodactylus.sone.freenet.plugin.PluginConnector;
@@ -40,18 +41,6 @@ import net.pterodactylus.util.logging.Logging;
 import net.pterodactylus.util.logging.LoggingListener;
 import net.pterodactylus.util.version.Version;
 
-import com.google.common.eventbus.EventBus;
-import com.google.inject.AbstractModule;
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-import com.google.inject.Singleton;
-import com.google.inject.TypeLiteral;
-import com.google.inject.matcher.Matchers;
-import com.google.inject.name.Names;
-import com.google.inject.spi.InjectionListener;
-import com.google.inject.spi.TypeEncounter;
-import com.google.inject.spi.TypeListener;
-
 import freenet.client.async.DatabaseDisabledException;
 import freenet.l10n.BaseL10n.LANGUAGE;
 import freenet.l10n.PluginL10n;
@@ -67,6 +56,18 @@ import freenet.pluginmanager.PluginRespirator;
 import freenet.support.SimpleFieldSet;
 import freenet.support.api.Bucket;
 
+import com.google.common.eventbus.EventBus;
+import com.google.inject.AbstractModule;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Singleton;
+import com.google.inject.TypeLiteral;
+import com.google.inject.matcher.Matchers;
+import com.google.inject.name.Names;
+import com.google.inject.spi.InjectionListener;
+import com.google.inject.spi.TypeEncounter;
+import com.google.inject.spi.TypeListener;
+
 /**
  * This class interfaces with Freenet. It is the class that is loaded by the
  * node and starts up the whole Sone system.
@@ -100,7 +101,7 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
        }
 
        /** The version. */
-       public static final Version VERSION = new Version(0, 8, 4);
+       public static final Version VERSION = new Version(0, 8, 7);
 
        /** The logger. */
        private static final Logger logger = Logging.getLogger(SonePlugin.class);
@@ -158,9 +159,6 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
        // FREDPLUGIN METHODS
        //
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        public void runPlugin(PluginRespirator pluginRespirator) {
                this.pluginRespirator = pluginRespirator;
@@ -209,6 +207,8 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
 
                        @Override
                        protected void configure() {
+                               bind(Core.class).in(Singleton.class);
+                               bind(MemoryDatabase.class).in(Singleton.class);
                                bind(EventBus.class).toInstance(eventBus);
                                bind(Configuration.class).toInstance(startConfiguration);
                                bind(FreenetInterface.class).in(Singleton.class);
@@ -219,7 +219,8 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
                                bind(String.class).annotatedWith(Names.named("WebOfTrustContext")).toInstance("Sone");
                                bind(SonePlugin.class).toInstance(SonePlugin.this);
                                bind(FcpInterface.class).in(Singleton.class);
-                               bind(PostBuilderFactory.class).to(DefaultPostBuilderFactory.class).in(Singleton.class);
+                               bind(Database.class).to(MemoryDatabase.class);
+                               bind(SoneProvider.class).to(Core.class).in(Singleton.class);
                                bindListener(Matchers.any(), new TypeListener() {
 
                                        @Override
@@ -274,9 +275,6 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
                }
        }
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        public void terminate() {
                try {
@@ -285,9 +283,6 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
 
                        /* stop the core. */
                        core.stop();
-
-                       /* stop the web of trust connector. */
-                       webOfTrustConnector.stop();
                } catch (Throwable t1) {
                        logger.log(Level.SEVERE, "Error while shutting down!", t1);
                } finally {
@@ -300,9 +295,6 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
        // INTERFACE FredPluginFCP
        //
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        public void handle(PluginReplySender pluginReplySender, SimpleFieldSet parameters, Bucket data, int accessType) {
                fcpInterface.handle(pluginReplySender, parameters, data, accessType);
@@ -312,17 +304,11 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
        // INTERFACE FredPluginL10n
        //
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        public String getString(String key) {
                return l10n.getBase().getString(key);
        }
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        public void setLanguage(LANGUAGE newLanguage) {
                l10n = new PluginL10n(this, newLanguage);
@@ -332,33 +318,21 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
        // INTERFACE FredPluginBaseL10n
        //
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        public String getL10nFilesBasePath() {
                return "i18n";
        }
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        public String getL10nFilesMask() {
                return "sone.${lang}.properties";
        }
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        public String getL10nOverrideFilesMask() {
                return "sone.${lang}.override.properties";
        }
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        public ClassLoader getPluginClassLoader() {
                return SonePlugin.class.getClassLoader();
@@ -368,9 +342,6 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
        // INTERFACE FredPluginVersioned
        //
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        public String getVersion() {
                return VERSION.toString();