List of usage examples for org.apache.commons.collections LRUMap LRUMap
public LRUMap(int i)
From source file:org.seasar.struts.portlet.SAStrutsPortlet.java
protected ProcessActionConfig getProcessActionConfig(PortletRequest request, Integer accessId) { PortletSession portletSession = request.getPortletSession(); String currentPortletMode = request.getPortletMode().toString(); String previousPortletMode = (String) portletSession.getAttribute(PREVIOUS_PORTLET_MODE); // set portlet mode portletSession.setAttribute(PREVIOUS_PORTLET_MODE, currentPortletMode); if (isPortletModeChange(currentPortletMode, previousPortletMode)) { // portlet mode was changed. clear cache. portletSession.setAttribute(PortletUtil.PROCESS_ACTION_CONFIG_MAP, new LRUMap(maxCacheSize)); return null; }//from w ww .j a va2s . com Map configMap = (Map) portletSession.getAttribute(PortletUtil.PROCESS_ACTION_CONFIG_MAP); if (configMap == null) { configMap = new LRUMap(maxCacheSize); portletSession.setAttribute(PortletUtil.PROCESS_ACTION_CONFIG_MAP, configMap); } return (ProcessActionConfig) configMap.get(accessId); }