added clearCache function to reset the application cache.

This commit is contained in:
hns 2001-11-26 17:30:50 +00:00
parent 49474a3317
commit ffd9564328

View file

@ -31,6 +31,7 @@ public class ESAppNode extends ESNode {
putHiddenProperty("getActiveThreads", new AppCountActiveEvaluators ("getActiveThreads", evaluator, fp));
putHiddenProperty("getMaxActiveThreads", new AppCountMaxActiveEvaluators ("getMaxActiveThreads", evaluator, fp));
putHiddenProperty("setMaxThreads", new AppSetNumberOfEvaluators ("setMaxThreads", evaluator, fp));
putHiddenProperty("clearCache", new AppClearCache ("clearCache", evaluator, fp));
}
/**
@ -129,6 +130,16 @@ public class ESAppNode extends ESNode {
}
}
class AppClearCache extends BuiltinFunctionObject {
AppClearCache (String name, Evaluator evaluator, FunctionPrototype fp) {
super (fp, evaluator, name, 1);
}
public ESValue callFunction (ESObject thisObject, ESValue[] arguments) throws EcmaScriptException {
app.clearCache ();
return ESBoolean.makeBoolean (true);
}
}
public String toString () {
return ("AppNode "+node.getElementName ());