Index: lams_admin/conf/language/lams/ApplicationResources.properties
===================================================================
diff -u -r1331b40e2fbc07867d59bcff24d0223d38ee7d5b -r4f40b2a39d2e2a4fcaeebe3568eb91858732fb8f
--- lams_admin/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 1331b40e2fbc07867d59bcff24d0223d38ee7d5b)
+++ lams_admin/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 4f40b2a39d2e2a4fcaeebe3568eb91858732fb8f)
@@ -172,10 +172,15 @@
cache.maintain =Maintain LAMS Cache
cache.title =Cache Management
cache.entries.title =Cache Nodes
+cache.entries.title2 =Cacheable entities
cache.explanation1 =Listed below are the current nodes in the cache. This keeps certain common objects in memory to speed up LAMS. It is managed automatically and should not require any intervention. However, if the system appears to be keeping "old values" e.g. an old first name, try clearing all the nodes in the cache. Once cleared, LAMS will reload the objects from the database.
cache.explanation2 =Warning: Removing nodes will reduce the performance of the LAMS server. After a while, the cache will build up again and LAMS will run as usual.
cache.explanation3 =Warning: If you remove a node, you will remove the node and all its child nodes.
+cache.explanation4 =Listed below are cacheable classes and collections. This keeps certain common objects in memory to speed up LAMS. It is managed automatically and should not require any intervention. However, if the system appears to be keeping "old values" e.g. an old first name, try clearing all the nodes in the cache. Once cleared, LAMS will reload the objects from the database.
cache.button.remove =Remove
+cache.button.remove.all =Clear all cached objects
+cache.removed =Objects bound with entity name {0} were removed
+cache.removed.all =All cached objects were removed
admin.config.key =Key
admin.config.value =Value
admin.register.sitename =Full Sitename
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/CacheAction.java
===================================================================
diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r4f40b2a39d2e2a4fcaeebe3568eb91858732fb8f
--- lams_admin/src/java/org/lamsfoundation/lams/admin/web/CacheAction.java (.../CacheAction.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/CacheAction.java (.../CacheAction.java) (revision 4f40b2a39d2e2a4fcaeebe3568eb91858732fb8f)
@@ -25,6 +25,7 @@
import java.io.IOException;
import java.util.Map;
+import java.util.Set;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -35,15 +36,16 @@
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.lamsfoundation.lams.cache.CacheManager;
+import org.lamsfoundation.lams.cache.ICacheManager;
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.action.LamsDispatchAction;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
/**
- * this is an action where all lams client environments launch.
- * initial configuration of the individual environment setting is done here.
+ * This is an action where all lams client environments launch.
+ * Initial configuration of the individual environment setting is done here.
*
* @struts:action name="CacheActionForm"
* path="/cache"
@@ -58,7 +60,7 @@
public static final String NODE_KEY = "node";
private static Logger log = Logger.getLogger(CacheAction.class);
- private static CacheManager manager;
+ private static ICacheManager cacheManager;
/**
* request for sysadmin environment
*/
@@ -67,11 +69,12 @@
throws IOException, ServletException {
try {
+ if (log.isDebugEnabled()) {
+ log.debug("Cache lookup");
+ }
- log.debug("cache lookup");
-
// todo restrict access to admin only. Can't do at present as don't know orgID
- log.error("CacheAction should be restricted to admin only. No check being done. Please implement.");
+ log.warn("CacheAction should be restricted to admin only. No check being done. Please implement.");
/*String login = req.getRemoteUser();
int orgId = new Integer(req.getParameter("orgId")).intValue();
@@ -88,7 +91,7 @@
return mapping.findForward("error");
} */
- Map items = getManager().getCachedItems();
+ Set
-