From ed021c5354d1e31a407d1446b5baaae9bea66ef9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 15 Sep 2012 23:08:08 +0200 Subject: [PATCH] Hand in context to constructor. --- .../sone/freenet/wot/IdentityManager.java | 18 ++++++------------ .../java/net/pterodactylus/sone/main/SonePlugin.java | 3 +-- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java index 3c3c9f9..e6fa3be 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java +++ b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java @@ -59,7 +59,7 @@ public class IdentityManager extends AbstractService { private final WebOfTrustConnector webOfTrustConnector; /** The context to filter for. */ - private volatile String context; + private final String context; /** The currently known own identities. */ /* synchronize access on syncObject. */ @@ -70,10 +70,14 @@ public class IdentityManager extends AbstractService { * * @param webOfTrustConnector * The Web of Trust connector + * @param context + * The context to focus on (may be {@code null} to ignore + * contexts) */ - public IdentityManager(WebOfTrustConnector webOfTrustConnector) { + public IdentityManager(WebOfTrustConnector webOfTrustConnector, String context) { super("Sone Identity Manager", false); this.webOfTrustConnector = webOfTrustConnector; + this.context = context; } // @@ -105,16 +109,6 @@ public class IdentityManager extends AbstractService { // /** - * Sets the context to filter own identities and trusted identities for. - * - * @param context - * The context to filter for, or {@code null} to not filter - */ - public void setContext(String context) { - this.context = context; - } - - /** * Returns whether the Web of Trust plugin could be reached during the last * try. * diff --git a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java index d16e931..dcd9964 100644 --- a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java +++ b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java @@ -186,8 +186,7 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr /* create web of trust connector. */ PluginConnector pluginConnector = new PluginConnector(pluginRespirator); webOfTrustConnector = new WebOfTrustConnector(pluginConnector); - identityManager = new IdentityManager(webOfTrustConnector); - identityManager.setContext("Sone"); + identityManager = new IdentityManager(webOfTrustConnector, "Sone"); /* create trust updater. */ WebOfTrustUpdater trustUpdater = new WebOfTrustUpdater(webOfTrustConnector); -- 2.7.4