return ehcache.isKeyInCache(cckey.getKey());
}
public void put(CacheElement element)
{
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();
try
{
ehcache.put(ehl);
}
catch (Exception e)
{
e.printStackTrace();
}
Element userElement = ehcache.get(userKey);
if (userElement == null)
{
Map map = Collections.synchronizedMap(new HashMap());
map.put(windowId, ccElement.getContentCacheKey());
userElement = new Element(userKey, map);
ehcache.put(userElement);
}
else
{
Map map = (Map)userElement.getObjectValue();
map.put(windowId, ccElement.getContentCacheKey());
}
}