Author: toad
Date: 2008-09-24 19:38:46 +0000 (Wed, 24 Sep 2008)
New Revision: 22820

Modified:
   trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
   trunk/freenet/src/freenet/node/Node.java
Log:
Let the user change connectToSeednodes by restarting the node.


Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties
===================================================================
--- trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties   2008-09-24 
19:15:26 UTC (rev 22819)
+++ trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties   2008-09-24 
19:38:46 UTC (rev 22820)
@@ -643,6 +643,7 @@
 Node.buggyJVMTitle=Buggy JVM Warning
 Node.buggyJVMWithLink=The JVM you are using (${version}) is known to be 
${link}buggy${/link}. It may produce OutOfMemoryError's when there is plenty of 
memory available. Please upgrade to at least Sun Java 1.4.2_13, 1.5.0_10 or 1.6 
(recommended).
 Node.bwlimitMustBePositive=Bandwidth limit must be positive
+Node.connectToSeednodesCannotBeChangedMustDisableOpennetOrReboot=Connect to 
seednodes setting: Cannot disable while opennet is running, either disable and 
then re-enable opennet or restart the node.
 Node.databaseMemory=Datastore maximum memory usage
 Node.databaseMemoryLong=Maximum memory usage of the database backing the 
datastore indexes. 0 means no limit (limited to ~ 30% of maximum memory)
 Node.deadlockTitle=Deadlocking likely due to buggy JVM/kernel combination

Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java    2008-09-24 19:15:26 UTC (rev 
22819)
+++ trunk/freenet/src/freenet/node/Node.java    2008-09-24 19:38:46 UTC (rev 
22820)
@@ -1262,21 +1262,15 @@
                                return isAllowedToConnectToSeednodes;
                        }
                        @Override
-                       public void set(Boolean val) throws 
InvalidConfigValueException {
+                       public void set(Boolean val) throws 
InvalidConfigValueException, NodeNeedRestartException {
                                if (get().equals(val))
                                                return;
                                synchronized(Node.this) {
+                                       isAllowedToConnectToSeednodes = val;
                                        if(opennet != null)
-                                               throw new 
InvalidConfigValueException("Can't change that setting on the fly when opennet 
is already active!");
-                                       else
-                                               isAllowedToConnectToSeednodes = 
val;
+                                               throw new 
NodeNeedRestartException(l10n("connectToSeednodesCannotBeChangedMustDisableOpennetOrReboot"));
                                }
                        }
-
-                       @Override
-                       public boolean isReadOnly() {
-                                       return opennet != null;
-                               }
                });
                isAllowedToConnectToSeednodes = 
opennetConfig.getBoolean("connectToSeednodes");



Reply via email to