From: David ‘Bombe’ Roden Date: Tue, 12 Oct 2010 12:10:46 +0000 (+0200) Subject: Set Freenet interface in core. X-Git-Tag: 0.1-RC1~538 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ca0d9d2f705bc8304f4bcd1fea1f38dec3f661e9;p=Sone.git Set Freenet interface in core. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 84e813e..f56c1ce 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -46,6 +46,9 @@ public class Core extends AbstractService { /** The configuration. */ private Configuration configuration; + /** Interface to freenet. */ + private FreenetInterface freenetInterface; + /** The local Sones. */ private final Set localSones = new HashSet(); @@ -72,6 +75,18 @@ public class Core extends AbstractService { return this; } + /** + * Sets the Freenet interface to use. + * + * @param freenetInterface + * The Freenet interface to use + * @return This core (for method chaining) + */ + public Core freenetInterface(FreenetInterface freenetInterface) { + this.freenetInterface = freenetInterface; + return this; + } + // // ACTIONS // diff --git a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java index be4f1fb..f1cda58 100644 --- a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java +++ b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java @@ -23,6 +23,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import net.pterodactylus.sone.core.Core; +import net.pterodactylus.sone.core.FreenetInterface; import net.pterodactylus.sone.freenet.PluginStoreConfigurationBackend; import net.pterodactylus.util.config.Configuration; import net.pterodactylus.util.config.ConfigurationException; @@ -76,9 +77,13 @@ public class SonePlugin implements FredPlugin { } } + /* create freenet interface. */ + FreenetInterface freenetInterface = new FreenetInterface(pluginRespirator.getNode()); + /* create core. */ core = new Core(); core.configuration(configuration); + core.freenetInterface(freenetInterface); /* start core! */ core.start();