Author: nextgens
Date: 2007-04-16 13:48:13 +0000 (Mon, 16 Apr 2007)
New Revision: 12762
Added:
trunk/freenet/src/freenet/config/ConfigCallback.java
trunk/freenet/src/freenet/config/EnumerableOptionCallback.java
Removed:
trunk/freenet/src/freenet/config/EnumerableOption.java
Modified:
trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
trunk/freenet/src/freenet/clients/http/ConfigToadlet.java
trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
trunk/freenet/src/freenet/config/BooleanOption.java
trunk/freenet/src/freenet/config/IntOption.java
trunk/freenet/src/freenet/config/LongOption.java
trunk/freenet/src/freenet/config/Option.java
trunk/freenet/src/freenet/config/ShortOption.java
trunk/freenet/src/freenet/config/StringArrOption.java
trunk/freenet/src/freenet/config/StringOption.java
trunk/freenet/src/freenet/node/LoggingConfigHandler.java
trunk/freenet/src/freenet/node/Node.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:
Refactor my changes to the Config framework so that it looks less hackish
Modified: trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
===================================================================
--- trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
2007-04-16 08:50:16 UTC (rev 12761)
+++ trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
2007-04-16 13:48:13 UTC (rev 12762)
@@ -8,8 +8,8 @@
import java.util.HashSet;
import java.util.LinkedList;
+import freenet.config.EnumerableOptionCallback;
import freenet.config.InvalidConfigValueException;
-import freenet.config.StringOption;
import freenet.config.SubConfig;
import freenet.crypt.RandomSource;
import freenet.keys.ClientKey;
@@ -38,8 +38,9 @@
private static boolean logMINOR;
- public class PrioritySchedulerCallback implements StringCallback{
+ public class PrioritySchedulerCallback implements StringCallback,
EnumerableOptionCallback {
final ClientRequestScheduler cs;
+ private final String[] possibleValues = new String[]{
ClientRequestScheduler.PRIORITY_HARD, ClientRequestScheduler.PRIORITY_SOFT };
PrioritySchedulerCallback(ClientRequestScheduler cs){
this.cs = cs;
@@ -64,6 +65,14 @@
}
cs.setPriorityScheduler(value);
}
+
+ public String[] getPossibleValues() {
+ return possibleValues;
+ }
+
+ public void setPossibleValues(String[] val) {
+ throw new NullPointerException("Should not happen!");
+ }
}
/**
@@ -156,7 +165,6 @@
"RequestStarterGroup.scheduler",
"RequestStarterGroup.schedulerLong",
new PrioritySchedulerCallback(this));
- ((StringOption)sc.getOption(name +
"_priority_policy")).setPossibleValues(new String[]{
ClientRequestScheduler.PRIORITY_HARD, ClientRequestScheduler.PRIORITY_SOFT });
this.choosenPriorityScheduler =
sc.getString(name+"_priority_policy");
logMINOR = Logger.shouldLog(Logger.MINOR, this);
Modified: trunk/freenet/src/freenet/clients/http/ConfigToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/ConfigToadlet.java 2007-04-16
08:50:16 UTC (rev 12761)
+++ trunk/freenet/src/freenet/clients/http/ConfigToadlet.java 2007-04-16
13:48:13 UTC (rev 12762)
@@ -9,7 +9,7 @@
import freenet.client.HighLevelSimpleClient;
import freenet.config.Config;
-import freenet.config.EnumerableOption;
+import freenet.config.EnumerableOptionCallback;
import freenet.config.Option;
import freenet.config.SubConfig;
import freenet.l10n.L10n;
@@ -156,8 +156,8 @@
continue;
}
- if((o[j] instanceof EnumerableOption)
&& (o[j].isEnumerable()))
-
configItemValueNode.addChild(addComboBox((EnumerableOption)o[j], sc[i],
configName));
+ if(o[j].getCallback() instanceof
EnumerableOptionCallback)
+
configItemValueNode.addChild(addComboBox((EnumerableOptionCallback)o[j].getCallback(),
sc[i], configName));
else
configItemValueNode.addChild("input", new String[] { "type", "class", "alt",
"name", "value" }, new String[] { "text", "config", o[j].getShortDesc(),
sc[i].getPrefix() + '.' + configName, o[j].getValueString() });
@@ -182,11 +182,11 @@
return "GET, POST";
}
- private HTMLNode addComboBox(EnumerableOption o, SubConfig sc, String
name) {
+ private HTMLNode addComboBox(EnumerableOptionCallback o, SubConfig sc,
String name) {
HTMLNode result = new HTMLNode("select", "name", sc.getPrefix()
+ '.' + name);
String[] possibleValues = o.getPossibleValues();
for(int i=0; i<possibleValues.length; i++) {
- if(possibleValues[i].equals(o.getValueString()))
+ if(possibleValues[i].equals(o.get()))
result.addChild("option", new String[] {
"value", "selected" }, new String[] { possibleValues[i], "selected" },
possibleValues[i]);
else
result.addChild("option", "value",
possibleValues[i], possibleValues[i]);
Modified: trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
2007-04-16 08:50:16 UTC (rev 12761)
+++ trunk/freenet/src/freenet/clients/http/SimpleToadletServer.java
2007-04-16 13:48:13 UTC (rev 12762)
@@ -22,8 +22,8 @@
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
+import freenet.config.EnumerableOptionCallback;
import freenet.config.InvalidConfigValueException;
-import freenet.config.StringOption;
import freenet.config.SubConfig;
import freenet.io.AllowedHosts;
import freenet.io.NetworkInterface;
@@ -109,7 +109,7 @@
}
- class FProxyCSSNameCallback implements StringCallback {
+ class FProxyCSSNameCallback implements StringCallback,
EnumerableOptionCallback {
public String get() {
return cssName;
@@ -121,6 +121,14 @@
cssName = CSSName;
pageMaker.setTheme(cssName);
}
+
+ public void setPossibleValues(String[] val) {
+ throw new NullPointerException("Should not happen!");
+ }
+
+ public String[] getPossibleValues() {
+ return
StringArray.toArray(pageMaker.getThemes().toArray());
+ }
}
class FProxyCSSOverrideCallback implements StringCallback {
@@ -306,10 +314,8 @@
cssName = fproxyConfig.getString("css");
if((cssName.indexOf(':') != -1) || (cssName.indexOf('/') != -1))
throw new InvalidConfigValueException("CSS name must
not contain slashes or colons!");
- pageMaker = new PageMaker(cssName);
- // Set possible values
- ((StringOption)
fproxyConfig.getOption("css")).setPossibleValues(StringArray.toArray(pageMaker.getThemes().toArray()));
-
+ pageMaker = new PageMaker(cssName);
+
if(!fproxyConfig.getOption("CSSOverride").isDefault()) {
cssOverride = new
File(fproxyConfig.getString("CSSOverride"));
pageMaker.setOverride(cssOverride);
Modified: trunk/freenet/src/freenet/config/BooleanOption.java
===================================================================
--- trunk/freenet/src/freenet/config/BooleanOption.java 2007-04-16 08:50:16 UTC
(rev 12761)
+++ trunk/freenet/src/freenet/config/BooleanOption.java 2007-04-16 13:48:13 UTC
(rev 12762)
@@ -5,7 +5,7 @@
import freenet.support.api.BooleanCallback;
-public class BooleanOption extends Option implements EnumerableOption {
+public class BooleanOption extends Option {
final boolean defaultValue;
final BooleanCallback cb;
@@ -13,7 +13,7 @@
public BooleanOption(SubConfig conf, String optionName, boolean
defaultValue, int sortOrder,
boolean expert, boolean forceWrite, String shortDesc,
String longDesc, BooleanCallback cb) {
- super(conf, optionName, sortOrder, expert, forceWrite,
shortDesc, longDesc);
+ super(conf, optionName, cb, sortOrder, expert, forceWrite,
shortDesc, longDesc);
this.defaultValue = defaultValue;
this.cb = cb;
this.currentValue = defaultValue;
@@ -66,14 +66,4 @@
public void setDefault() {
currentValue = defaultValue;
}
-
- public String[] getPossibleValues() {
- return new String[] { "true", "false" };
- }
-
- public void setPossibleValues(String[] val) {}
-
- public boolean isEnumerable() {
- return true;
- }
}
Added: trunk/freenet/src/freenet/config/ConfigCallback.java
===================================================================
--- trunk/freenet/src/freenet/config/ConfigCallback.java
(rev 0)
+++ trunk/freenet/src/freenet/config/ConfigCallback.java 2007-04-16
13:48:13 UTC (rev 12762)
@@ -0,0 +1,8 @@
+/* This code is part of Freenet. It is distributed under the GNU General
+ * Public License, version 2 (or at your option any later version). See
+ * http://www.gnu.org/ for further details of the GPL. */
+package freenet.config;
+
+public interface ConfigCallback {
+ /** Nothing usefull here */
+}
Deleted: trunk/freenet/src/freenet/config/EnumerableOption.java
===================================================================
--- trunk/freenet/src/freenet/config/EnumerableOption.java 2007-04-16
08:50:16 UTC (rev 12761)
+++ trunk/freenet/src/freenet/config/EnumerableOption.java 2007-04-16
13:48:13 UTC (rev 12762)
@@ -1,11 +0,0 @@
-/* This code is part of Freenet. It is distributed under the GNU General
- * Public License, version 2 (or at your option any later version). See
- * http://www.gnu.org/ for further details of the GPL. */
-
-package freenet.config;
-
-public interface EnumerableOption {
- public String[] getPossibleValues();
- public void setPossibleValues(String[] val);
- public String getValueString();
-}
Copied: trunk/freenet/src/freenet/config/EnumerableOptionCallback.java (from
rev 12753, trunk/freenet/src/freenet/config/EnumerableOption.java)
===================================================================
--- trunk/freenet/src/freenet/config/EnumerableOptionCallback.java
(rev 0)
+++ trunk/freenet/src/freenet/config/EnumerableOptionCallback.java
2007-04-16 13:48:13 UTC (rev 12762)
@@ -0,0 +1,13 @@
+/* This code is part of Freenet. It is distributed under the GNU General
+ * Public License, version 2 (or at your option any later version). See
+ * http://www.gnu.org/ for further details of the GPL. */
+
+package freenet.config;
+
+public interface EnumerableOptionCallback {
+ public String[] getPossibleValues();
+ public void setPossibleValues(String[] val);
+
+ /** Return the current value */
+ public String get();
+}
Modified: trunk/freenet/src/freenet/config/IntOption.java
===================================================================
--- trunk/freenet/src/freenet/config/IntOption.java 2007-04-16 08:50:16 UTC
(rev 12761)
+++ trunk/freenet/src/freenet/config/IntOption.java 2007-04-16 13:48:13 UTC
(rev 12762)
@@ -17,7 +17,7 @@
public IntOption(SubConfig conf, String optionName, int defaultValue,
String defaultValueString,
int sortOrder, boolean expert, boolean forceWrite,
String shortDesc, String longDesc, IntCallback cb) {
- super(conf, optionName, sortOrder, expert, forceWrite,
shortDesc, longDesc);
+ super(conf, optionName, cb, sortOrder, expert, forceWrite,
shortDesc, longDesc);
this.defaultValue = defaultValue;
this.cb = cb;
this.currentValue = defaultValue;
@@ -26,7 +26,7 @@
public IntOption(SubConfig conf, String optionName, String
defaultValueString,
int sortOrder, boolean expert, boolean forceWrite,
String shortDesc, String longDesc, IntCallback cb) {
- super(conf, optionName, sortOrder, expert, forceWrite,
shortDesc, longDesc);
+ super(conf, optionName, cb, sortOrder, expert, forceWrite,
shortDesc, longDesc);
this.defaultValue = Fields.parseInt(defaultValueString);
this.cb = cb;
this.currentValue = defaultValue;
Modified: trunk/freenet/src/freenet/config/LongOption.java
===================================================================
--- trunk/freenet/src/freenet/config/LongOption.java 2007-04-16 08:50:16 UTC
(rev 12761)
+++ trunk/freenet/src/freenet/config/LongOption.java 2007-04-16 13:48:13 UTC
(rev 12762)
@@ -17,7 +17,7 @@
public LongOption(SubConfig conf, String optionName, long defaultValue,
String defaultValueString,
int sortOrder, boolean expert, boolean forceWrite,
String shortDesc, String longDesc, LongCallback cb) {
- super(conf, optionName, sortOrder, expert, forceWrite,
shortDesc, longDesc);
+ super(conf, optionName, cb, sortOrder, expert, forceWrite,
shortDesc, longDesc);
this.defaultValue = defaultValue;
this.cb = cb;
this.currentValue = defaultValue;
@@ -26,7 +26,7 @@
public LongOption(SubConfig conf, String optionName, String
defaultValueString,
int sortOrder, boolean expert, boolean forceWrite,
String shortDesc, String longDesc, LongCallback cb) {
- super(conf, optionName, sortOrder, expert, forceWrite,
shortDesc, longDesc);
+ super(conf, optionName, cb, sortOrder, expert, forceWrite,
shortDesc, longDesc);
this.defaultValue = Fields.parseLong(defaultValueString);
this.cb = cb;
this.currentValue = defaultValue;
Modified: trunk/freenet/src/freenet/config/Option.java
===================================================================
--- trunk/freenet/src/freenet/config/Option.java 2007-04-16 08:50:16 UTC
(rev 12761)
+++ trunk/freenet/src/freenet/config/Option.java 2007-04-16 13:48:13 UTC
(rev 12762)
@@ -22,10 +22,13 @@
final String shortDesc;
/** Long description of value e.g. "The TCP port to listen for FCP
connections on" */
final String longDesc;
+ /** The configCallback associated to the Option */
+ final ConfigCallback cb;
- Option(SubConfig config, String name, int sortOrder, boolean expert,
boolean forceWrite, String shortDesc, String longDesc) {
+ Option(SubConfig config, String name, ConfigCallback cb, int sortOrder,
boolean expert, boolean forceWrite, String shortDesc, String longDesc) {
this.config = config;
this.name = name;
+ this.cb = cb;
this.sortOrder = sortOrder;
this.expert = expert;
this.shortDesc = shortDesc;
@@ -91,8 +94,8 @@
public abstract void setDefault();
public abstract String getDefault();
-
- public boolean isEnumerable() {
- return false;
+
+ public ConfigCallback getCallback() {
+ return cb;
}
}
Modified: trunk/freenet/src/freenet/config/ShortOption.java
===================================================================
--- trunk/freenet/src/freenet/config/ShortOption.java 2007-04-16 08:50:16 UTC
(rev 12761)
+++ trunk/freenet/src/freenet/config/ShortOption.java 2007-04-16 13:48:13 UTC
(rev 12762)
@@ -11,7 +11,7 @@
public ShortOption(SubConfig conf, String optionName, short
defaultValue, int sortOrder,
boolean expert, boolean forceWrite, String shortDesc,
String longDesc, ShortCallback cb) {
- super(conf, optionName, sortOrder, expert, forceWrite,
shortDesc, longDesc);
+ super(conf, optionName, cb, sortOrder, expert, forceWrite,
shortDesc, longDesc);
this.defaultValue = defaultValue;
this.cb = cb;
this.currentValue = defaultValue;
Modified: trunk/freenet/src/freenet/config/StringArrOption.java
===================================================================
--- trunk/freenet/src/freenet/config/StringArrOption.java 2007-04-16
08:50:16 UTC (rev 12761)
+++ trunk/freenet/src/freenet/config/StringArrOption.java 2007-04-16
13:48:13 UTC (rev 12762)
@@ -17,7 +17,7 @@
public StringArrOption(SubConfig conf, String optionName, String[]
defaultValue, int sortOrder,
boolean expert, boolean forceWrite, String shortDesc,
String longDesc, StringArrCallback cb) {
- super(conf, optionName, sortOrder, expert, forceWrite,
shortDesc, longDesc);
+ super(conf, optionName, cb, sortOrder, expert, forceWrite,
shortDesc, longDesc);
this.defaultValue = (defaultValue==null)?new
String[0]:defaultValue;
this.cb = cb;
this.currentValue = (defaultValue==null)?new
String[0]:defaultValue;
Modified: trunk/freenet/src/freenet/config/StringOption.java
===================================================================
--- trunk/freenet/src/freenet/config/StringOption.java 2007-04-16 08:50:16 UTC
(rev 12761)
+++ trunk/freenet/src/freenet/config/StringOption.java 2007-04-16 13:48:13 UTC
(rev 12762)
@@ -5,16 +5,15 @@
import freenet.support.api.StringCallback;
-public class StringOption extends Option implements EnumerableOption {
+public class StringOption extends Option {
final String defaultValue;
final StringCallback cb;
private String currentValue;
- private String[] possibleValues;
public StringOption(SubConfig conf, String optionName, String
defaultValue, int sortOrder,
boolean expert, boolean forceWrite, String shortDesc,
String longDesc, StringCallback cb) {
- super(conf, optionName, sortOrder, expert, forceWrite,
shortDesc, longDesc);
+ super(conf, optionName, cb, sortOrder, expert, forceWrite,
shortDesc, longDesc);
this.defaultValue = defaultValue;
this.cb = cb;
this.currentValue = defaultValue;
@@ -53,16 +52,4 @@
public String getDefault(){
return defaultValue;
}
-
- public void setPossibleValues(String[] val) {
- possibleValues = val;
- }
-
- public String[] getPossibleValues() {
- return possibleValues;
- }
-
- public boolean isEnumerable() {
- return (possibleValues != null);
- }
}
Modified: trunk/freenet/src/freenet/node/LoggingConfigHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/LoggingConfigHandler.java 2007-04-16
08:50:16 UTC (rev 12761)
+++ trunk/freenet/src/freenet/node/LoggingConfigHandler.java 2007-04-16
13:48:13 UTC (rev 12762)
@@ -6,9 +6,9 @@
import java.io.File;
import java.io.IOException;
+import freenet.config.EnumerableOptionCallback;
import freenet.config.InvalidConfigValueException;
import freenet.config.OptionFormatException;
-import freenet.config.StringOption;
import freenet.config.SubConfig;
import freenet.support.FileLoggerHook;
import freenet.support.Logger;
@@ -22,7 +22,31 @@
import freenet.support.api.StringCallback;
public class LoggingConfigHandler {
+ private class PriorityCallback implements StringCallback,
EnumerableOptionCallback {
+ private final String[] possibleValues = new String[]{ "ERROR",
"NORMAL", "MINOR", "DEBUG" };
+ public String get() {
+ LoggerHookChain chain = Logger.getChain();
+ return LoggerHook.priorityOf(chain.getThreshold());
+ }
+ public void set(String val) throws InvalidConfigValueException {
+ LoggerHookChain chain = Logger.getChain();
+ try {
+ chain.setThreshold(val);
+ } catch (LoggerHook.InvalidThresholdException e) {
+ throw new OptionFormatException(e.getMessage());
+ }
+ }
+
+ public String[] getPossibleValues() {
+ return possibleValues;
+ }
+
+ public void setPossibleValues(String[] val) {
+ throw new NullPointerException("Should not happen!");
+ }
+ }
+
protected static final String LOG_PREFIX = "freenet";
private final SubConfig config;
private FileLoggerHook fileLoggerHook;
@@ -103,21 +127,7 @@
// Node must override this to minor on testnet.
config.register("priority", "normal", 4, false, false,
"LogConfigHandler.minLoggingPriority",
"LogConfigHandler.minLoggingPriorityLong",
- new StringCallback() {
- public String get() {
- LoggerHookChain chain =
Logger.getChain();
- return
LoggerHook.priorityOf(chain.getThreshold());
- }
- public void set(String val) throws
InvalidConfigValueException {
- LoggerHookChain chain =
Logger.getChain();
- try {
- chain.setThreshold(val);
- } catch
(LoggerHook.InvalidThresholdException e) {
- throw new
OptionFormatException(e.getMessage());
- }
- }
- });
- ((StringOption)config.getOption("priority")).setPossibleValues(new
String[]{ "ERROR", "NORMAL", "MINOR", "DEBUG" });
+ new PriorityCallback());
// detailed priority
Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java 2007-04-16 08:50:16 UTC (rev
12761)
+++ trunk/freenet/src/freenet/node/Node.java 2007-04-16 13:48:13 UTC (rev
12762)
@@ -40,11 +40,11 @@
import com.sleepycat.je.StatsConfig;
import freenet.client.FetchContext;
+import freenet.config.EnumerableOptionCallback;
import freenet.config.FreenetFilePersistentConfig;
import freenet.config.InvalidConfigValueException;
import freenet.config.LongOption;
import freenet.config.PersistentConfig;
-import freenet.config.StringOption;
import freenet.config.SubConfig;
import freenet.crypt.DSA;
import freenet.crypt.DSAGroup;
@@ -167,6 +167,30 @@
}
}
+ private class L10nCallback implements StringCallback,
EnumerableOptionCallback{
+
+ public String get() {
+ return L10n.getSelectedLanguage();
+ }
+
+ public void set(String val) throws InvalidConfigValueException {
+ if(get().equalsIgnoreCase(val)) return;
+ try {
+ L10n.setLanguage(val);
+ } catch (MissingResourceException e) {
+ throw new
InvalidConfigValueException(e.getMessage());
+ }
+ }
+
+ public void setPossibleValues(String[] val) {
+ throw new NullPointerException("Should not happen!");
+ }
+
+ public String[] getPossibleValues() {
+ return L10n.availableLanguages;
+ }
+ }
+
/** Stats */
public final NodeStats nodeStats;
@@ -1306,22 +1330,7 @@
nodeConfig.register("l10n", "en", sortOrder++, false, true,
"Node.l10nLanguage",
"Node.l10nLanguageLong",
- new StringCallback(){
-
- public String get() {
- return L10n.getSelectedLanguage();
- }
-
- public void set(String val) throws
InvalidConfigValueException {
- if(get().equalsIgnoreCase(val)) return;
- try {
- L10n.setLanguage(val);
- } catch (MissingResourceException e) {
- throw new
InvalidConfigValueException(e.getMessage());
- }
- }
- });
-
((StringOption)nodeConfig.getOption("l10n")).setPossibleValues(L10n.availableLanguages);
+ new L10nCallback());
try {
L10n.setLanguage(nodeConfig.getString("l10n"));
Modified: trunk/freenet/src/freenet/support/api/BooleanCallback.java
===================================================================
--- trunk/freenet/src/freenet/support/api/BooleanCallback.java 2007-04-16
08:50:16 UTC (rev 12761)
+++ trunk/freenet/src/freenet/support/api/BooleanCallback.java 2007-04-16
13:48:13 UTC (rev 12762)
@@ -3,13 +3,14 @@
* http://www.gnu.org/ for further details of the GPL. */
package freenet.support.api;
+import freenet.config.ConfigCallback;
import freenet.config.InvalidConfigValueException;
/**
* A callback to be called when a config value of integer type changes.
* Also reports the current value.
*/
-public interface BooleanCallback {
+public interface BooleanCallback extends ConfigCallback {
/**
* Get the current, used value of the config variable.
Modified: trunk/freenet/src/freenet/support/api/IntCallback.java
===================================================================
--- trunk/freenet/src/freenet/support/api/IntCallback.java 2007-04-16
08:50:16 UTC (rev 12761)
+++ trunk/freenet/src/freenet/support/api/IntCallback.java 2007-04-16
13:48:13 UTC (rev 12762)
@@ -3,13 +3,14 @@
* http://www.gnu.org/ for further details of the GPL. */
package freenet.support.api;
+import freenet.config.ConfigCallback;
import freenet.config.InvalidConfigValueException;
/**
* A callback to be called when a config value of integer type changes.
* Also reports the current value.
*/
-public interface IntCallback {
+public interface IntCallback extends ConfigCallback {
/**
* Get the current, used value of the config variable.
Modified: trunk/freenet/src/freenet/support/api/LongCallback.java
===================================================================
--- trunk/freenet/src/freenet/support/api/LongCallback.java 2007-04-16
08:50:16 UTC (rev 12761)
+++ trunk/freenet/src/freenet/support/api/LongCallback.java 2007-04-16
13:48:13 UTC (rev 12762)
@@ -3,13 +3,14 @@
* http://www.gnu.org/ for further details of the GPL. */
package freenet.support.api;
+import freenet.config.ConfigCallback;
import freenet.config.InvalidConfigValueException;
/**
* A callback to be called when a config value of long type changes.
* Also reports the current value.
*/
-public interface LongCallback {
+public interface LongCallback extends ConfigCallback {
/**
* Get the current, used value of the config variable.
Modified: trunk/freenet/src/freenet/support/api/ShortCallback.java
===================================================================
--- trunk/freenet/src/freenet/support/api/ShortCallback.java 2007-04-16
08:50:16 UTC (rev 12761)
+++ trunk/freenet/src/freenet/support/api/ShortCallback.java 2007-04-16
13:48:13 UTC (rev 12762)
@@ -1,12 +1,13 @@
package freenet.support.api;
+import freenet.config.ConfigCallback;
import freenet.config.InvalidConfigValueException;
/**
* A callback to be called when a config value of short type changes.
* Also reports the current value.
*/
-public interface ShortCallback {
+public interface ShortCallback extends ConfigCallback {
/**
* Get the current, used value of the config variable.
Modified: trunk/freenet/src/freenet/support/api/StringArrCallback.java
===================================================================
--- trunk/freenet/src/freenet/support/api/StringArrCallback.java
2007-04-16 08:50:16 UTC (rev 12761)
+++ trunk/freenet/src/freenet/support/api/StringArrCallback.java
2007-04-16 13:48:13 UTC (rev 12762)
@@ -3,10 +3,11 @@
* http://www.gnu.org/ for further details of the GPL. */
package freenet.support.api;
+import freenet.config.ConfigCallback;
import freenet.config.InvalidConfigValueException;
/** Callback (getter/setter) for a string config variable */
-public interface StringArrCallback {
+public interface StringArrCallback extends ConfigCallback {
/**
* Get the current, used value of the config variable.
Modified: trunk/freenet/src/freenet/support/api/StringCallback.java
===================================================================
--- trunk/freenet/src/freenet/support/api/StringCallback.java 2007-04-16
08:50:16 UTC (rev 12761)
+++ trunk/freenet/src/freenet/support/api/StringCallback.java 2007-04-16
13:48:13 UTC (rev 12762)
@@ -3,10 +3,11 @@
* http://www.gnu.org/ for further details of the GPL. */
package freenet.support.api;
+import freenet.config.ConfigCallback;
import freenet.config.InvalidConfigValueException;
/** Callback (getter/setter) for a string config variable */
-public interface StringCallback {
+public interface StringCallback extends ConfigCallback {
/**
* Get the current, used value of the config variable.