From: David ‘Bombe’ Roden Date: Wed, 5 Sep 2012 09:58:35 +0000 (+0200) Subject: Create trust updater and store it in the core. X-Git-Tag: 0.8.3^2~54^2~13 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=574cc9332f37a95d61359e4a91255bce846fb34a Create trust updater and store it in the core. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 4001f46..4b79c3f 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -112,6 +112,9 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis /** The update checker. */ private final UpdateChecker updateChecker; + /** The trust updater. */ + private final TrustUpdater trustUpdater; + /** The FCP interface. */ private volatile FcpInterface fcpInterface; @@ -185,7 +188,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis * @param identityManager * The identity manager */ - public Core(Configuration configuration, FreenetInterface freenetInterface, IdentityManager identityManager) { + public Core(Configuration configuration, FreenetInterface freenetInterface, IdentityManager identityManager, TrustUpdater trustUpdater) { super("Sone Core"); this.configuration = configuration; this.freenetInterface = freenetInterface; @@ -193,6 +196,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis this.soneDownloader = new SoneDownloader(this, freenetInterface); this.imageInserter = new ImageInserter(this, freenetInterface); this.updateChecker = new UpdateChecker(freenetInterface); + this.trustUpdater = trustUpdater; } // @@ -1967,6 +1971,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis loadConfiguration(); updateChecker.addUpdateListener(this); updateChecker.start(); + trustUpdater.start(); } /** @@ -1999,6 +2004,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis soneInserter.stop(); } } + trustUpdater.stop(); updateChecker.stop(); updateChecker.removeUpdateListener(this); soneDownloader.stop(); diff --git a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java index cca2c7b..a02165e 100644 --- a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java +++ b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java @@ -24,6 +24,7 @@ import java.util.logging.Logger; import net.pterodactylus.sone.core.Core; import net.pterodactylus.sone.core.FreenetInterface; +import net.pterodactylus.sone.core.TrustUpdater; import net.pterodactylus.sone.fcp.FcpInterface; import net.pterodactylus.sone.freenet.PluginStoreConfigurationBackend; import net.pterodactylus.sone.freenet.plugin.PluginConnector; @@ -188,8 +189,12 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr identityManager = new IdentityManager(webOfTrustConnector); identityManager.setContext("Sone"); + /* create trust updater. */ + TrustUpdater trustUpdater = new TrustUpdater(webOfTrustConnector); + trustUpdater.init(); + /* create core. */ - core = new Core(oldConfiguration, freenetInterface, identityManager); + core = new Core(oldConfiguration, freenetInterface, identityManager, trustUpdater); /* create the web interface. */ webInterface = new WebInterface(this);