From ffd9564328e4b533c55bb0a958e94b69055d197e Mon Sep 17 00:00:00 2001 From: hns Date: Mon, 26 Nov 2001 17:30:50 +0000 Subject: [PATCH] added clearCache function to reset the application cache. --- src/helma/scripting/fesi/ESAppNode.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/helma/scripting/fesi/ESAppNode.java b/src/helma/scripting/fesi/ESAppNode.java index 1b3e15f1..f31f28ec 100644 --- a/src/helma/scripting/fesi/ESAppNode.java +++ b/src/helma/scripting/fesi/ESAppNode.java @@ -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 ());