public CacheElement createElement(Object key, Object content) { ContentCacheKey cckey = (ContentCacheKey)key; Element cachedElement = new Element(cckey.getKey(), content); return new EhDecorationContentCacheElementImpl(cachedElement, cckey); }
Element ehl = impl.getImplElement(); String userKey = ccElement.getContentCacheKey().getSessionId(); if (userKey == null)
public boolean remove(Object key) { CacheElement element = this.get(key); boolean removed = false; if (element == null) return false; ContentCacheElement ccElement = (ContentCacheElement)element; EhDecorationContentCacheElementImpl impl = (EhDecorationContentCacheElementImpl)element; Element ehl = impl.getImplElement(); String userKey = ccElement.getContentCacheKey().getSessionId(); if (userKey == null) { userKey = ccElement.getContentCacheKey().getUsername(); } String windowId = ccElement.getContentCacheKey().getWindowId(); removed = ehcache.remove(ccElement.getContentCacheKey().getKey()); Element userElement = ehcache.get(userKey); if (userElement != null) { Map map = (Map)userElement.getObjectValue(); if (map != null) { map.remove(windowId); } } return removed; }
public CacheElement get(Object key) { ContentCacheKey cckey = (ContentCacheKey)key; Element element = ehcache.get(cckey.getKey()); if (element == null) return null; return new EhDecorationContentCacheElementImpl(element, cckey); }