Author: toad
Date: 2007-09-08 16:11:26 +0000 (Sat, 08 Sep 2007)
New Revision: 15053
Modified:
trunk/freenet/src/freenet/node/NodeIPDetector.java
trunk/freenet/src/freenet/pluginmanager/PluginInfoWrapper.java
trunk/freenet/src/freenet/pluginmanager/PluginManager.java
Log:
Support removing IP detector plugins and port forward plugins
Modified: trunk/freenet/src/freenet/node/NodeIPDetector.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeIPDetector.java 2007-09-08 16:05:43 UTC
(rev 15052)
+++ trunk/freenet/src/freenet/node/NodeIPDetector.java 2007-09-08 16:11:26 UTC
(rev 15053)
@@ -412,8 +412,12 @@
public void registerIPDetectorPlugin(FredPluginIPDetector detector) {
ipDetectorManager.register(detector);
- } // FIXME what about unloading?
+ }
+ public void unregisterIPDetectorPlugin(FredPluginIPDetector detector) {
+ ipDetectorManager.remove(detector);
+ }
+
public synchronized boolean isDetecting() {
return !(hasDetectedPM && hasDetectedIAD);
}
@@ -445,5 +449,8 @@
public void registerPortForwardPlugin(FredPluginPortForward forward) {
ipDetectorManager.registerPortForwardPlugin(forward);
}
-
+
+ public void unregisterPortForwardPlugin(FredPluginPortForward forward) {
+ ipDetectorManager.remove(forward);
+ }
}
Modified: trunk/freenet/src/freenet/pluginmanager/PluginInfoWrapper.java
===================================================================
--- trunk/freenet/src/freenet/pluginmanager/PluginInfoWrapper.java
2007-09-08 16:05:43 UTC (rev 15052)
+++ trunk/freenet/src/freenet/pluginmanager/PluginInfoWrapper.java
2007-09-08 16:11:26 UTC (rev 15053)
@@ -126,6 +126,10 @@
unregistered = true;
}
manager.unregisterPluginToadlet(this);
+ if(isIPDetectorPlugin)
+
manager.node.ipDetector.unregisterIPDetectorPlugin((FredPluginIPDetector)plug);
+ if(isPortForwardPlugin)
+
manager.node.ipDetector.unregisterPortForwardPlugin((FredPluginPortForward)plug);
}
public boolean isPproxyPlugin() {
Modified: trunk/freenet/src/freenet/pluginmanager/PluginManager.java
===================================================================
--- trunk/freenet/src/freenet/pluginmanager/PluginManager.java 2007-09-08
16:05:43 UTC (rev 15052)
+++ trunk/freenet/src/freenet/pluginmanager/PluginManager.java 2007-09-08
16:11:26 UTC (rev 15053)
@@ -51,7 +51,7 @@
private final HashMap toadletList;
private final Vector/*<PluginInfoWrapper>*/ pluginWrappers;
private PluginRespirator pluginRespirator = null;
- private final Node node;
+ final Node node;
private final NodeClientCore core;
SubConfig pmconfig;
private boolean logMINOR;