From 22ec65ab3b21ac52ad91e08939551f648bad2240 Mon Sep 17 00:00:00 2001 From: stefanp Date: Mon, 30 Sep 2002 09:41:55 +0000 Subject: [PATCH] added property app.cacheusage that holds current number of elements in the object cache. --- src/helma/framework/core/ApplicationBean.java | 4 ++++ src/helma/objectmodel/db/NodeManager.java | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/helma/framework/core/ApplicationBean.java b/src/helma/framework/core/ApplicationBean.java index 599e4c46..79826957 100644 --- a/src/helma/framework/core/ApplicationBean.java +++ b/src/helma/framework/core/ApplicationBean.java @@ -114,6 +114,10 @@ public class ApplicationBean implements Serializable { // getter methods for readonly properties of this application + public int getcacheusage () { + return app.nmgr.countCacheEntries (); + } + public INode getdata() { return app.getCacheNode (); } diff --git a/src/helma/objectmodel/db/NodeManager.java b/src/helma/objectmodel/db/NodeManager.java index 48029c43..874c79d1 100644 --- a/src/helma/objectmodel/db/NodeManager.java +++ b/src/helma/objectmodel/db/NodeManager.java @@ -1160,6 +1160,13 @@ public final class NodeManager { return cache.getEntryArray (); } + /** + * Get the number of elements in the object cache + */ + public int countCacheEntries () { + return cache.size (); + } + /** * Clear the object cache, causing all objects to be recreated. */