public synchronized static Object cacheLookup(Identity oid) { CacheElement element = oidCache.get(oid); if (element != null) { return element.getContent(); } return null; }
private void setCachedContent( String cacheKey, String content ) { CacheElement cachedElement = desktopContentCache.createElement( cacheKey, content ); cachedElement.setTimeToIdleSeconds(desktopContentCache.getTimeToIdleSeconds()); cachedElement.setTimeToLiveSeconds(desktopContentCache.getTimeToLiveSeconds()); desktopContentCache.put( cachedElement ); }
public EhDecorationContentCacheImpl(Ehcache ehcache, JetspeedCache preferenceCache, ContentCacheKeyGenerator keyGenerator) { this(ehcache); this.preferenceCache = preferenceCache; this.keyGenerator = keyGenerator; preferenceCache.addEventListener(this,false); //only listen to remote events }
public void putIntoService(List<String> fullPortletNames) { for (String fullName : fullPortletNames) { trackingCache.remove(fullName); } }
protected void clearTargetCache(String fragmentId, RequestContext context) { ContentCacheKey cacheKey = portletContentCache.createCacheKey(context, fragmentId); if (portletContentCache.isKeyInCache(cacheKey)) { portletContentCache.remove(cacheKey); portletContentCache.invalidate(context); } }
/** * get an iterator over the cache values * * @return iterator over the cache values */ public List getKeys() { return cache.getKeys(); }
/** * Evicts all entries * */ public void evictAll() { this.cache.clear(); }
/** * Returns whether this cache is currently part of a distributed cache cluster. * * @return distributed flag */ public static boolean isDistributed() { return (pathCache.isDistributed() && propertiesPathCache.isDistributed() && principalPropertiesPathCache.isDistributed()); }
/** * get the size of the cache * * @return the size of the cache */ public int getSize() { return cache.getSize(); } }
protected void addToCache(NodeCache content) { CacheElement cachedElement = preferenceCache.createElement(content.getCacheKey(), content); cachedElement.setTimeToIdleSeconds(preferenceCache.getTimeToIdleSeconds()); cachedElement.setTimeToLiveSeconds(preferenceCache.getTimeToLiveSeconds()); preferenceCache.put(cachedElement); }
public synchronized static Object cacheLookup(Identity oid) { CacheElement element = oidCache.get(oid); if (element != null) { return element.getContent(); } return null; }
/** * Removes a file entry from the file cache * * @param key the full path name of the file * @return the entry removed */ public Object remove(String key) { boolean removed = this.cache.remove(key); return null; }
public EhPortletContentCacheImpl(Ehcache ehcache, JetspeedCache preferenceCache, ContentCacheKeyGenerator keyGenerator) { this(ehcache); this.preferenceCache = preferenceCache; this.keyGenerator = keyGenerator; preferenceCache.addEventListener(this,false); //only listen to remote events }
private static void removeFromCache(RequestContext context, String id, JetspeedContentCache cache) { if (cache != null) { ContentCacheKey cacheKey = cache.createCacheKey(context, id); if (cache.isKeyInCache(cacheKey)) { cache.remove(cacheKey); } cache.invalidate(context); } }
private String getCachedContent( String cacheKey ) { CacheElement cachedElement = desktopContentCache.get(cacheKey); if (cachedElement != null) return (String)cachedElement.getContent(); return null; } private void setCachedContent( String cacheKey, String content )
public EhPortletContentCacheImpl(Ehcache ehcache, JetspeedCache preferenceCache) { this(ehcache); this.preferenceCache = preferenceCache; preferenceCache.addEventListener(this,false); //only listen to remote events }
protected void removeFromCache(RequestContext context, String id, JetspeedContentCache cache) { if (cache == null) return; ContentCacheKey cacheKey = cache.createCacheKey(context, id); if (cache.isKeyInCache(cacheKey)) { cache.remove(cacheKey); } cache.invalidate(context); }
private NodeCache getNode(String cacheKey) { CacheElement cachedElement = preferenceCache.get(cacheKey); if (cachedElement != null) return (NodeCache)cachedElement.getContent(); return null; }
public EhDecorationContentCacheImpl(Ehcache ehcache, JetspeedCache preferenceCache) { this(ehcache); this.preferenceCache = preferenceCache; preferenceCache.addEventListener(this,false); //only listen to remote events }