added clearCache function to reset the application cache.
This commit is contained in:
parent
49474a3317
commit
ffd9564328
1 changed files with 11 additions and 0 deletions
|
@ -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 ());
|
||||
|
|
Loading…
Add table
Reference in a new issue