Author: j16sdiz
Date: 2008-08-14 08:41:17 +0000 (Thu, 14 Aug 2008)
New Revision: 21837
Modified:
trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java
trunk/freenet/src/freenet/config/ConfigCallback.java
trunk/freenet/src/freenet/crypt/SSL.java
trunk/freenet/src/freenet/node/ConfigurablePersister.java
trunk/freenet/src/freenet/node/LoggingConfigHandler.java
trunk/freenet/src/freenet/node/Node.java
trunk/freenet/src/freenet/node/NodeClientCore.java
trunk/freenet/src/freenet/node/NodeCryptoConfig.java
trunk/freenet/src/freenet/node/NodeIPDetector.java
trunk/freenet/src/freenet/node/NodeStats.java
trunk/freenet/src/freenet/node/TestnetHandler.java
trunk/freenet/src/freenet/node/TextModeClientInterfaceServer.java
trunk/freenet/src/freenet/node/fcp/FCPServer.java
trunk/freenet/src/freenet/node/updater/NodeUpdateManager.java
trunk/freenet/src/freenet/oldplugins/plugin/PluginManager.java
trunk/freenet/src/freenet/pluginmanager/PluginManager.java
trunk/freenet/src/freenet/support/api/BooleanCallback.java
trunk/freenet/src/freenet/support/api/IntCallback.java
trunk/freenet/src/freenet/support/api/LongCallback.java
trunk/freenet/src/freenet/support/api/ShortCallback.java
trunk/freenet/src/freenet/support/api/StringArrCallback.java
trunk/freenet/src/freenet/support/api/StringCallback.java
Log:
retry r21834
Modified: trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
===================================================================
--- trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
2008-08-14 08:40:29 UTC (rev 21836)
+++ trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
2008-08-14 08:41:17 UTC (rev 21837)
@@ -41,7 +41,7 @@
private static boolean logMINOR;
- public static class PrioritySchedulerCallback implements
StringCallback, EnumerableOptionCallback {
+ public static class PrioritySchedulerCallback extends StringCallback
implements EnumerableOptionCallback {
final ClientRequestScheduler cs;
private final String[] possibleValues = new String[]{
ClientRequestScheduler.PRIORITY_HARD, ClientRequestScheduler.PRIORITY_SOFT };
Modified: trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
2008-08-14 08:40:29 UTC (rev 21836)
+++ trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
2008-08-14 08:41:17 UTC (rev 21837)
@@ -80,7 +80,7 @@
static boolean isPanicButtonToBeShown;
public static final int DEFAULT_FPROXY_PORT = 8888;
- class FProxySSLCallback implements BooleanCallback {
+ class FProxySSLCallback extends BooleanCallback {
public boolean get() {
return ssl;
@@ -93,9 +93,12 @@
ssl = val;
throw new InvalidConfigValueException("Cannot change
SSL on the fly, please restart freenet");
}
+ public boolean isReadOnly() {
+ return true;
+ }
}
- class FProxyPassthruMaxSize implements IntCallback {
+ class FProxyPassthruMaxSize extends IntCallback {
public int get() {
return FProxyToadlet.MAX_LENGTH;
@@ -107,7 +110,7 @@
}
}
- class FProxyPortCallback implements IntCallback {
+ class FProxyPortCallback extends IntCallback {
public int get() {
return port;
@@ -118,9 +121,12 @@
throw new
InvalidConfigValueException(L10n.getString("cannotChangePortOnTheFly"));
// FIXME
}
+ public boolean isReadOnly() {
+ return true;
+ }
}
- class FProxyBindtoCallback implements StringCallback {
+ class FProxyBindtoCallback extends StringCallback {
public String get() {
return bindTo;
@@ -141,7 +147,7 @@
}
}
- class FProxyAllowedHostsCallback implements StringCallback {
+ class FProxyAllowedHostsCallback extends StringCallback {
public String get() {
return networkInterface.getAllowedHosts();
@@ -152,10 +158,9 @@
networkInterface.setAllowedHosts(allowedHosts);
}
}
-
}
- class FProxyCSSNameCallback implements StringCallback,
EnumerableOptionCallback {
+ class FProxyCSSNameCallback extends StringCallback implements
EnumerableOptionCallback {
public String get() {
return cssName;
@@ -177,7 +182,7 @@
}
}
- class FProxyCSSOverrideCallback implements StringCallback {
+ class FProxyCSSOverrideCallback extends StringCallback {
public String get() {
return (cssOverride == null ? "" :
cssOverride.toString());
@@ -199,7 +204,7 @@
}
}
- class FProxyEnabledCallback implements BooleanCallback {
+ class FProxyEnabledCallback extends BooleanCallback {
public boolean get() {
synchronized(SimpleToadletServer.this) {
@@ -241,7 +246,7 @@
}
}
- private static class FProxyAdvancedModeEnabledCallback implements
BooleanCallback {
+ private static class FProxyAdvancedModeEnabledCallback extends
BooleanCallback {
private final SimpleToadletServer ts;
@@ -259,7 +264,7 @@
}
}
- private static class FProxyJavascriptEnabledCallback implements
BooleanCallback {
+ private static class FProxyJavascriptEnabledCallback extends
BooleanCallback {
private final SimpleToadletServer ts;
Modified: trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java
2008-08-14 08:40:29 UTC (rev 21836)
+++ trunk/freenet/src/freenet/clients/http/SymlinkerToadlet.java
2008-08-14 08:41:17 UTC (rev 21837)
@@ -35,6 +35,10 @@
// FIXME
throw new InvalidConfigValueException("Cannot
set the plugins that's loaded.");
}
+
+ public boolean isReadOnly() {
+ return true;
+ }
});
String fns[] = tslconfig.getStringArr("symlinks");
Modified: trunk/freenet/src/freenet/config/ConfigCallback.java
===================================================================
--- trunk/freenet/src/freenet/config/ConfigCallback.java 2008-08-14
08:40:29 UTC (rev 21836)
+++ trunk/freenet/src/freenet/config/ConfigCallback.java 2008-08-14
08:41:17 UTC (rev 21837)
@@ -3,6 +3,8 @@
* http://www.gnu.org/ for further details of the GPL. */
package freenet.config;
-public interface ConfigCallback {
- /** Nothing usefull here */
+public abstract class ConfigCallback {
+ public boolean isReadOnly() {
+ return false;
+ }
}
Modified: trunk/freenet/src/freenet/crypt/SSL.java
===================================================================
--- trunk/freenet/src/freenet/crypt/SSL.java 2008-08-14 08:40:29 UTC (rev
21836)
+++ trunk/freenet/src/freenet/crypt/SSL.java 2008-08-14 08:41:17 UTC (rev
21837)
@@ -15,7 +15,6 @@
*/
package freenet.crypt;
-import com.sleepycat.je.utilint.NotImplementedYetException;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
@@ -24,16 +23,18 @@
import java.security.Key;
import java.security.KeyStore;
import java.security.cert.Certificate;
+
import javax.net.ServerSocketFactory;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
+import com.sleepycat.je.utilint.NotImplementedYetException;
+
import freenet.config.InvalidConfigValueException;
import freenet.config.SubConfig;
import freenet.support.Logger;
import freenet.support.api.BooleanCallback;
import freenet.support.api.StringCallback;
-
import freenet.support.io.Closer;
public class SSL {
Modified: trunk/freenet/src/freenet/node/ConfigurablePersister.java
===================================================================
--- trunk/freenet/src/freenet/node/ConfigurablePersister.java 2008-08-14
08:40:29 UTC (rev 21836)
+++ trunk/freenet/src/freenet/node/ConfigurablePersister.java 2008-08-14
08:41:17 UTC (rev 21837)
@@ -22,7 +22,6 @@
public void set(String val) throws
InvalidConfigValueException {
setThrottles(val);
}
-
});
String throttleFile = nodeConfig.getString(optionName);
Modified: trunk/freenet/src/freenet/node/LoggingConfigHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/LoggingConfigHandler.java 2008-08-14
08:40:29 UTC (rev 21836)
+++ trunk/freenet/src/freenet/node/LoggingConfigHandler.java 2008-08-14
08:41:17 UTC (rev 21837)
@@ -23,7 +23,7 @@
import freenet.support.api.StringCallback;
public class LoggingConfigHandler {
- private static class PriorityCallback implements StringCallback,
EnumerableOptionCallback {
+ private static class PriorityCallback extends StringCallback implements
EnumerableOptionCallback {
private final String[] possibleValues = new String[]{ "ERROR",
"NORMAL", "MINOR", "DEBUG" };
public String get() {
@@ -45,7 +45,7 @@
public void setPossibleValues(String[] val) {
throw new NullPointerException("Should not happen!");
- }
+ }
}
protected static final String LOG_PREFIX = "freenet";
Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java 2008-08-14 08:40:29 UTC (rev
21836)
+++ trunk/freenet/src/freenet/node/Node.java 2008-08-14 08:41:17 UTC (rev
21837)
@@ -3,6 +3,7 @@
import java.io.BufferedReader;
import java.io.File;
+import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
@@ -118,7 +119,6 @@
import freenet.support.io.FileUtil;
import freenet.support.io.NativeThread;
import freenet.support.transport.ip.HostnameSyntaxException;
-import java.io.FileFilter;
/**
* @author amphibian
@@ -132,7 +132,7 @@
private static TimeSkewDetectedUserAlert timeSkewDetectedUserAlert;
private final static ClockProblemDetectedUserAlert
clockProblemDetectedUserAlert = new ClockProblemDetectedUserAlert();
- public class NodeNameCallback implements StringCallback {
+ public class NodeNameCallback extends StringCallback {
GetPubkey node;
NodeNameCallback(GetPubkey n) {
@@ -170,7 +170,7 @@
}
}
- private class StoreTypeCallback implements StringCallback,
EnumerableOptionCallback {
+ private class StoreTypeCallback extends StringCallback implements
EnumerableOptionCallback {
public String get() {
return storeType;
@@ -190,10 +190,13 @@
public void setPossibleValues(String[] val) {
throw new UnsupportedOperationException();
}
-
+
+ public boolean isReadOnly() {
+ return true;
+ }
}
- private static class L10nCallback implements StringCallback,
EnumerableOptionCallback {
+ private static class L10nCallback extends StringCallback implements
EnumerableOptionCallback {
public String get() {
return
L10n.mapLanguageNameToLongName(L10n.getSelectedLanguage());
@@ -754,6 +757,9 @@
// Don't translate the below as
very few users will use it.
throw new
InvalidConfigValueException("Moving node directory on the fly not supported at
present");
}
+ public boolean isReadOnly() {
+ return true;
+ }
});
nodeDir = new File(nodeConfig.getString("nodeDir"));
@@ -858,7 +864,10 @@
public void set(boolean val) throws
InvalidConfigValueException {
throw new InvalidConfigValueException("Cannot
change on the fly");
}
-
+
+ public boolean isReadOnly() {
+ return true;
+ }
});
enableARKs = nodeConfig.getBoolean("enableARKs");
@@ -871,7 +880,10 @@
public void set(boolean val) throws
InvalidConfigValueException {
throw new InvalidConfigValueException("Cannot
change on the fly");
}
-
+
+ public boolean isReadOnly() {
+ return true;
+ }
});
enablePerNodeFailureTables =
nodeConfig.getBoolean("enablePerNodeFailureTables");
@@ -884,7 +896,10 @@
public void set(boolean val) throws
InvalidConfigValueException {
throw new InvalidConfigValueException("Cannot
change on the fly");
}
-
+
+ public boolean isReadOnly() {
+ return true;
+ }
});
enableULPRDataPropagation =
nodeConfig.getBoolean("enableULPRDataPropagation");
@@ -897,7 +912,10 @@
public void set(boolean val) throws
InvalidConfigValueException {
throw new InvalidConfigValueException("Cannot
change on the fly");
}
-
+
+ public boolean isReadOnly() {
+ return true;
+ }
});
enableSwapping = nodeConfig.getBoolean("enableSwapping");
@@ -1152,6 +1170,10 @@
isAllowedToConnectToSeednodes =
val;
}
}
+
+ public boolean isReadOnly() {
+ return opennet != null;
+ }
});
isAllowedToConnectToSeednodes =
opennetConfig.getBoolean("connectToSeednodes");
@@ -1259,6 +1281,9 @@
// FIXME
throw new
InvalidConfigValueException("Moving extra peer data directory on the fly not
supported at present");
}
+ public boolean isReadOnly() {
+ return true;
+ }
});
extraPeerDataDir = new
File(nodeConfig.getString("extraPeerDataDir"));
if(!((extraPeerDataDir.exists() &&
extraPeerDataDir.isDirectory()) || (extraPeerDataDir.mkdir()))) {
@@ -1354,6 +1379,9 @@
// FIXME
throw new
InvalidConfigValueException("Moving datastore on the fly not supported at
present");
}
+ public boolean isReadOnly() {
+ return true;
+ }
});
final String suffix = "-" + getDarknetPortNumber();
@@ -1639,7 +1667,6 @@
public void set(boolean val) throws
InvalidConfigValueException {
disableHangCheckers = val;
}
-
});
disableHangCheckers =
nodeConfig.getBoolean("disableHangCheckers");
Modified: trunk/freenet/src/freenet/node/NodeClientCore.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeClientCore.java 2008-08-14 08:40:29 UTC
(rev 21836)
+++ trunk/freenet/src/freenet/node/NodeClientCore.java 2008-08-14 08:41:17 UTC
(rev 21837)
@@ -154,6 +154,9 @@
// FIXME
throw new
InvalidConfigValueException(l10n("movingTempDirOnTheFlyNotSupported"));
}
+ public boolean isReadOnly() {
+ return true;
+ }
});
tempDir = new File(nodeConfig.getString("tempDir"));
@@ -195,6 +198,9 @@
// FIXME
throw new
InvalidConfigValueException("Moving persistent temp directory on the fly not
supported at present");
}
+ public boolean isReadOnly() {
+ return true;
+ }
});
try {
persistentTempBucketFactory = new
PersistentTempBucketFactory(new
File(nodeConfig.getString("persistentTempDir")), "freenet-temp-", random,
node.fastWeakRandom, nodeConfig.getBoolean("encryptPersistentTempBuckets"));
Modified: trunk/freenet/src/freenet/node/NodeCryptoConfig.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeCryptoConfig.java 2008-08-14
08:40:29 UTC (rev 21836)
+++ trunk/freenet/src/freenet/node/NodeCryptoConfig.java 2008-08-14
08:41:17 UTC (rev 21837)
@@ -73,6 +73,9 @@
portNumber = val;
}
}
+ public boolean isReadOnly() {
+ return true;
+ }
});
try{
@@ -111,7 +114,7 @@
if(crypto == null)
return;
}
crypto.onSetDropProbability(val);
- }
+ }
});
dropProbability = config.getInt("testingDropPacketsEvery");
@@ -147,7 +150,7 @@
synchronized(NodeCryptoConfig.this) {
alwaysAllowLocalAddresses = val;
}
- }
+ }
});
alwaysAllowLocalAddresses =
config.getBoolean("alwaysAllowLocalAddresses");
@@ -159,7 +162,7 @@
public void set(boolean val) throws
InvalidConfigValueException {
assumeNATed = val;
- }
+ }
});
assumeNATed = config.getBoolean("assumeNATed");
}
@@ -188,7 +191,7 @@
return portNumber;
}
- class NodeBindtoCallback implements StringCallback {
+ class NodeBindtoCallback extends StringCallback {
public String get() {
return bindTo.toString();
@@ -199,6 +202,9 @@
// FIXME why not? Can't we use
freenet.io.NetworkInterface like everywhere else, just adapt it for UDP?
throw new InvalidConfigValueException("Cannot be
updated on the fly");
}
+ public boolean isReadOnly() {
+ return true;
+ }
}
public synchronized FreenetInetAddress getBindTo() {
Modified: trunk/freenet/src/freenet/node/NodeIPDetector.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeIPDetector.java 2008-08-14 08:40:29 UTC
(rev 21836)
+++ trunk/freenet/src/freenet/node/NodeIPDetector.java 2008-08-14 08:41:17 UTC
(rev 21837)
@@ -373,7 +373,6 @@
}
redetectAddress();
}
-
});
hasValidAddressOverride = true;
@@ -420,7 +419,6 @@
}
redetectAddress();
}
-
});
String ipHintString = nodeConfig.getString("tempIPAddressHint");
@@ -448,7 +446,6 @@
lastIPAddress = null;
ipDetector.clearCached();
}
-
});
includeLocalAddressesInNoderefs =
nodeConfig.getBoolean("includeLocalAddressesInNoderefs");
Modified: trunk/freenet/src/freenet/node/NodeStats.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeStats.java 2008-08-14 08:40:29 UTC
(rev 21836)
+++ trunk/freenet/src/freenet/node/NodeStats.java 2008-08-14 08:41:17 UTC
(rev 21837)
@@ -270,7 +270,6 @@
ignoreLocalVsRemoteBandwidthLiability =
val;
}
}
-
});
persister = new ConfigurablePersister(this, statsConfig,
"nodeThrottleFile", "node-throttle.dat", sortOrder++, true, false,
Modified: trunk/freenet/src/freenet/node/TestnetHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/TestnetHandler.java 2008-08-14 08:40:29 UTC
(rev 21836)
+++ trunk/freenet/src/freenet/node/TestnetHandler.java 2008-08-14 08:41:17 UTC
(rev 21837)
@@ -208,7 +208,7 @@
}
- private static class TestnetEnabledCallback implements BooleanCallback {
+ private static class TestnetEnabledCallback extends BooleanCallback {
final Node node;
@@ -224,11 +224,14 @@
if(node.testnetEnabled == val) return;
throw new
InvalidConfigValueException(L10n.getString("TestnetHandler.cannotEnableDisableOnTheFly"));
}
-
+
+ public boolean isReadOnly() {
+ return true;
+ }
}
- static class TestnetPortNumberCallback implements IntCallback {
+ static class TestnetPortNumberCallback extends IntCallback {
Node node;
TestnetPortNumberCallback(Node n){
Modified: trunk/freenet/src/freenet/node/TextModeClientInterfaceServer.java
===================================================================
--- trunk/freenet/src/freenet/node/TextModeClientInterfaceServer.java
2008-08-14 08:40:29 UTC (rev 21836)
+++ trunk/freenet/src/freenet/node/TextModeClientInterfaceServer.java
2008-08-14 08:41:17 UTC (rev 21837)
@@ -103,7 +103,7 @@
}
- static class TMCIEnabledCallback implements BooleanCallback {
+ static class TMCIEnabledCallback extends BooleanCallback {
final NodeClientCore core;
@@ -120,9 +120,12 @@
// FIXME implement - see bug #122
throw new InvalidConfigValueException("Cannot be updated on the
fly");
}
+ public boolean isReadOnly() {
+ return true;
+ }
}
- static class TMCISSLCallback implements BooleanCallback {
+ static class TMCISSLCallback extends BooleanCallback {
public boolean get() {
return ssl;
@@ -136,9 +139,12 @@
ssl = val;
throw new InvalidConfigValueException("Cannot change SSL on the
fly, please restart freenet");
}
+ public boolean isReadOnly() {
+ return true;
+ }
}
- static class TMCIDirectEnabledCallback implements BooleanCallback {
+ static class TMCIDirectEnabledCallback extends BooleanCallback {
final NodeClientCore core;
@@ -155,9 +161,12 @@
// FIXME implement - see bug #122
throw new InvalidConfigValueException("Cannot be updated on the
fly");
}
+ public boolean isReadOnly() {
+ return true;
+ }
}
- static class TMCIBindtoCallback implements StringCallback {
+ static class TMCIBindtoCallback extends StringCallback {
final NodeClientCore core;
@@ -183,7 +192,7 @@
}
}
- static class TMCIAllowedHostsCallback implements StringCallback {
+ static class TMCIAllowedHostsCallback extends StringCallback {
private final NodeClientCore core;
@@ -208,10 +217,9 @@
throw new
InvalidConfigValueException("Setting allowedHosts for TMCI (console) server
when TMCI is disabled");
}
}
-
}
- static class TCMIPortNumberCallback implements IntCallback{
+ static class TCMIPortNumberCallback extends IntCallback {
final NodeClientCore core;
Modified: trunk/freenet/src/freenet/node/fcp/FCPServer.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPServer.java 2008-08-14 08:40:29 UTC
(rev 21836)
+++ trunk/freenet/src/freenet/node/fcp/FCPServer.java 2008-08-14 08:41:17 UTC
(rev 21837)
@@ -16,6 +16,7 @@
import java.io.OutputStreamWriter;
import java.net.Socket;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.Vector;
import java.util.WeakHashMap;
import java.util.zip.GZIPInputStream;
@@ -49,7 +50,6 @@
import freenet.support.api.StringCallback;
import freenet.support.io.Closer;
import freenet.support.io.FileUtil;
-import java.util.LinkedList;
/**
* FCP server process.
@@ -193,7 +193,7 @@
ch.start();
}
- static class FCPPortNumberCallback implements IntCallback {
+ static class FCPPortNumberCallback extends IntCallback {
private final NodeClientCore node;
@@ -210,9 +210,13 @@
throw new InvalidConfigValueException("Cannot
change FCP port number on the fly");
}
}
+
+ public boolean isReadOnly() {
+ return true;
+ }
}
- static class FCPEnabledCallback implements BooleanCallback{
+ static class FCPEnabledCallback extends BooleanCallback {
final NodeClientCore node;
@@ -229,9 +233,13 @@
throw new
InvalidConfigValueException(l10n("cannotStartOrStopOnTheFly"));
}
}
+
+ public boolean isReadOnly() {
+ return true;
+ }
}
- static class FCPSSLCallback implements BooleanCallback{
+ static class FCPSSLCallback extends BooleanCallback {
public boolean get() {
return ssl;
@@ -245,12 +253,16 @@
ssl = val;
throw new InvalidConfigValueException("Cannot change
SSL on the fly, please restart freenet");
}
+
+ public boolean isReadOnly() {
+ return true;
+ }
}
// FIXME: Consider moving everything except enabled into constructor
// Actually we could move enabled in too with an exception???
- static class FCPBindtoCallback implements StringCallback{
+ static class FCPBindtoCallback extends StringCallback {
final NodeClientCore node;
@@ -277,7 +289,7 @@
}
}
- static class FCPAllowedHostsCallback implements StringCallback {
+ static class FCPAllowedHostsCallback extends StringCallback {
private final NodeClientCore node;
@@ -296,12 +308,10 @@
if (!val.equals(get())) {
node.getFCPServer().networkInterface.setAllowedHosts(val);
}
- }
-
+ }
}
- static class FCPAllowedHostsFullAccessCallback implements
StringCallback {
-
+ static class FCPAllowedHostsFullAccessCallback extends StringCallback {
private final NodeClientCore node;
public FCPAllowedHostsFullAccessCallback(NodeClientCore node) {
@@ -320,7 +330,7 @@
}
- static class PersistentDownloadsEnabledCallback implements
BooleanCallback {
+ static class PersistentDownloadsEnabledCallback extends BooleanCallback
{
FCPServer server;
@@ -335,7 +345,7 @@
}
- static class PersistentDownloadsFileCallback implements StringCallback {
+ static class PersistentDownloadsFileCallback extends StringCallback {
FCPServer server;
@@ -350,7 +360,7 @@
}
}
- static class PersistentDownloadsIntervalCallback implements
LongCallback {
+ static class PersistentDownloadsIntervalCallback extends LongCallback {
FCPServer server;
@@ -369,7 +379,7 @@
}
}
- static class AssumeDDADownloadIsAllowedCallback implements
BooleanCallback{
+ static class AssumeDDADownloadIsAllowedCallback extends BooleanCallback
{
FCPServer server;
public boolean get() {
@@ -382,7 +392,7 @@
}
}
- static class AssumeDDAUploadIsAllowedCallback implements
BooleanCallback{
+ static class AssumeDDAUploadIsAllowedCallback extends BooleanCallback {
FCPServer server;
public boolean get() {
Modified: trunk/freenet/src/freenet/node/updater/NodeUpdateManager.java
===================================================================
--- trunk/freenet/src/freenet/node/updater/NodeUpdateManager.java
2008-08-14 08:40:29 UTC (rev 21836)
+++ trunk/freenet/src/freenet/node/updater/NodeUpdateManager.java
2008-08-14 08:41:17 UTC (rev 21837)
@@ -804,7 +804,7 @@
// Config callbacks
- class UpdaterEnabledCallback implements BooleanCallback {
+ class UpdaterEnabledCallback extends BooleanCallback {
public boolean get() {
return isEnabled();
@@ -815,7 +815,7 @@
}
}
- class AutoUpdateAllowedCallback implements BooleanCallback {
+ class AutoUpdateAllowedCallback extends BooleanCallback {
public boolean get() {
return isAutoUpdateAllowed();
@@ -826,7 +826,7 @@
}
}
- class UpdateURICallback implements StringCallback {
+ class UpdateURICallback extends StringCallback {
boolean isExt;
@@ -847,10 +847,9 @@
}
setURI(isExt, uri);
}
-
}
- public class UpdateRevocationURICallback implements StringCallback {
+ public class UpdateRevocationURICallback extends StringCallback {
public String get() {
return getRevocationURI().toString(false, false);
@@ -865,7 +864,6 @@
}
setRevocationURI(uri);
}
-
}
/** Called when a peer indicates in its UOMAnnounce that it has fetched
the revocation key
Modified: trunk/freenet/src/freenet/oldplugins/plugin/PluginManager.java
===================================================================
--- trunk/freenet/src/freenet/oldplugins/plugin/PluginManager.java
2008-08-14 08:40:29 UTC (rev 21836)
+++ trunk/freenet/src/freenet/oldplugins/plugin/PluginManager.java
2008-08-14 08:41:17 UTC (rev 21837)
@@ -84,6 +84,10 @@
public void set(String[] val) throws
InvalidConfigValueException {
throw new
InvalidConfigValueException(L10n.getString("PluginManager.cannotSetOnceLoaded"));
};
+
+ public boolean isReadOnly() {
+ return true;
+ }
});
String[] loadedPluginNames =
config.getStringArr("loadedPlugins");
Modified: trunk/freenet/src/freenet/pluginmanager/PluginManager.java
===================================================================
--- trunk/freenet/src/freenet/pluginmanager/PluginManager.java 2008-08-14
08:40:29 UTC (rev 21836)
+++ trunk/freenet/src/freenet/pluginmanager/PluginManager.java 2008-08-14
08:41:17 UTC (rev 21837)
@@ -127,6 +127,10 @@
// FIXME
throw new
InvalidConfigValueException(L10n.getString("PluginManager.cannotSetOnceLoaded"));
}
+
+ public boolean isReadOnly() {
+ return true;
+ }
});
String fns[] = pmconfig.getStringArr("loadplugin");
Modified: trunk/freenet/src/freenet/support/api/BooleanCallback.java
===================================================================
--- trunk/freenet/src/freenet/support/api/BooleanCallback.java 2008-08-14
08:40:29 UTC (rev 21836)
+++ trunk/freenet/src/freenet/support/api/BooleanCallback.java 2008-08-14
08:41:17 UTC (rev 21837)
@@ -10,12 +10,12 @@
* A callback to be called when a config value of integer type changes.
* Also reports the current value.
*/
-public interface BooleanCallback extends ConfigCallback {
+public abstract class BooleanCallback extends ConfigCallback {
/**
* Get the current, used value of the config variable.
*/
- boolean get();
+ public abstract boolean get();
/**
* Set the config variable to a new value.
@@ -23,6 +23,6 @@
* @throws InvalidConfigOptionException If the new value is invalid for
* this particular option.
*/
- void set(boolean val) throws InvalidConfigValueException;
+ public abstract void set(boolean val) throws
InvalidConfigValueException;
}
Modified: trunk/freenet/src/freenet/support/api/IntCallback.java
===================================================================
--- trunk/freenet/src/freenet/support/api/IntCallback.java 2008-08-14
08:40:29 UTC (rev 21836)
+++ trunk/freenet/src/freenet/support/api/IntCallback.java 2008-08-14
08:41:17 UTC (rev 21837)
@@ -10,12 +10,12 @@
* A callback to be called when a config value of integer type changes.
* Also reports the current value.
*/
-public interface IntCallback extends ConfigCallback {
+public abstract class IntCallback extends ConfigCallback {
/**
* Get the current, used value of the config variable.
*/
- int get();
+ public abstract int get();
/**
* Set the config variable to a new value.
@@ -23,6 +23,6 @@
* @throws InvalidConfigOptionException If the new value is invalid for
* this particular option.
*/
- void set(int val) throws InvalidConfigValueException;
+ public abstract void set(int val) throws InvalidConfigValueException;
}
Modified: trunk/freenet/src/freenet/support/api/LongCallback.java
===================================================================
--- trunk/freenet/src/freenet/support/api/LongCallback.java 2008-08-14
08:40:29 UTC (rev 21836)
+++ trunk/freenet/src/freenet/support/api/LongCallback.java 2008-08-14
08:41:17 UTC (rev 21837)
@@ -10,12 +10,12 @@
* A callback to be called when a config value of long type changes.
* Also reports the current value.
*/
-public interface LongCallback extends ConfigCallback {
+public abstract class LongCallback extends ConfigCallback {
/**
* Get the current, used value of the config variable.
*/
- long get();
+ public abstract long get();
/**
* Set the config variable to a new value.
@@ -23,6 +23,6 @@
* @throws InvalidConfigOptionException If the new value is invalid for
* this particular option.
*/
- void set(long val) throws InvalidConfigValueException;
+ public abstract void set(long val) throws InvalidConfigValueException;
}
Modified: trunk/freenet/src/freenet/support/api/ShortCallback.java
===================================================================
--- trunk/freenet/src/freenet/support/api/ShortCallback.java 2008-08-14
08:40:29 UTC (rev 21836)
+++ trunk/freenet/src/freenet/support/api/ShortCallback.java 2008-08-14
08:41:17 UTC (rev 21837)
@@ -7,12 +7,12 @@
* A callback to be called when a config value of short type changes.
* Also reports the current value.
*/
-public interface ShortCallback extends ConfigCallback {
+public abstract class ShortCallback extends ConfigCallback {
/**
* Get the current, used value of the config variable.
*/
- short get();
+ public abstract short get();
/**
* Set the config variable to a new value.
@@ -20,6 +20,6 @@
* @throws InvalidConfigOptionException If the new value is invalid for
* this particular option.
*/
- void set(short val) throws InvalidConfigValueException;
+ public abstract void set(short val) throws InvalidConfigValueException;
}
Modified: trunk/freenet/src/freenet/support/api/StringArrCallback.java
===================================================================
--- trunk/freenet/src/freenet/support/api/StringArrCallback.java
2008-08-14 08:40:29 UTC (rev 21836)
+++ trunk/freenet/src/freenet/support/api/StringArrCallback.java
2008-08-14 08:41:17 UTC (rev 21837)
@@ -7,12 +7,12 @@
import freenet.config.InvalidConfigValueException;
/** Callback (getter/setter) for a string config variable */
-public interface StringArrCallback extends ConfigCallback {
+public abstract class StringArrCallback extends ConfigCallback {
/**
* Get the current, used value of the config variable.
*/
- String[] get();
+ public abstract String[] get();
/**
* Set the config variable to a new value.
@@ -20,6 +20,6 @@
* @throws InvalidConfigOptionException If the new value is invalid for
* this particular option.
*/
- void set(String[] val) throws InvalidConfigValueException;
+ public abstract void set(String[] val) throws
InvalidConfigValueException;
}
Modified: trunk/freenet/src/freenet/support/api/StringCallback.java
===================================================================
--- trunk/freenet/src/freenet/support/api/StringCallback.java 2008-08-14
08:40:29 UTC (rev 21836)
+++ trunk/freenet/src/freenet/support/api/StringCallback.java 2008-08-14
08:41:17 UTC (rev 21837)
@@ -7,12 +7,12 @@
import freenet.config.InvalidConfigValueException;
/** Callback (getter/setter) for a string config variable */
-public interface StringCallback extends ConfigCallback {
+public abstract class StringCallback extends ConfigCallback {
/**
* Get the current, used value of the config variable.
*/
- String get();
+ public abstract String get();
/**
* Set the config variable to a new value.
@@ -20,6 +20,6 @@
* @throws InvalidConfigOptionException If the new value is invalid for
* this particular option.
*/
- void set(String val) throws InvalidConfigValueException;
+ public abstract void set(String val) throws InvalidConfigValueException;
}