public void notifyElementRemoved(JetspeedCache cache, boolean local, Object key, Object element) { DatabasePageManagerPrincipalKeyCacheObject cacheObject = (DatabasePageManagerPrincipalKeyCacheObject)element; // remove cache object from local principal properties cache String principalKey = ((cacheObject != null) ? cacheObject.getPrincipalKey() : (String)key); if (principalKey != null) { synchronized (DatabasePageManagerCache.class) { DatabasePageManagerCache.principalPropertiesCache.removeQuiet(principalKey); } } } }, false);
DatabasePageManagerCache.propertiesCache.removeQuiet(fragmentKey);
public synchronized static void cacheRemoveQuiet(String key, RegistryCacheObjectWrapper w) { RegistryCacheObjectWrapper wrapper = w; if (wrapper == null) { CacheElement cacheElement = nameCache.get(key); if (cacheElement != null) { wrapper = (RegistryCacheObjectWrapper) cacheElement.getContent(); } } if (wrapper == null) { return; } Identity oid = wrapper.getId(); PortletDefinition pd = (PortletDefinition)cacheLookup(oid); if (pd == null) return; oidCache.removeQuiet(oid); nameCache.removeQuiet(pd.getUniqueName()); }
/** * Clear node and all children based on specified path from cache. * * @param path full path of node to remove * @return count of nodes cleared from cache */ protected int clearCachedNodeAndAllChildren(String path) { int count = 0; String root = path.substring(0, path.length()-1); List preferenceCacheKeys = preferenceCache.getKeys(); for (Iterator iter = preferenceCacheKeys.iterator(); iter.hasNext();) { CacheElement preferenceCacheElement = preferenceCache.get(iter.next()); if (preferenceCacheElement != null) { String preferenceFullPath = ((NodeCache)preferenceCacheElement.getContent()).getNode().getFullPath(); if (preferenceFullPath.startsWith(path) || preferenceFullPath.equals(root)) { if (preferenceCache.removeQuiet(preferenceCacheElement.getKey())) { count++; } } } } return count; } }
public synchronized static void cacheRemoveQuiet(String key, RegistryCacheObjectWrapper w) { RegistryCacheObjectWrapper wrapper = w; if (wrapper == null) { CacheElement cacheElement = nameCache.get(key); if (cacheElement != null) { wrapper = (RegistryCacheObjectWrapper) cacheElement.getContent(); } } if (wrapper == null) { return; } Identity oid = wrapper.getId(); PortletApplication pd = (PortletApplication)cacheLookup(oid); if (pd == null) return; oidCache.removeQuiet(oid); nameCache.removeQuiet(pd.getName()); }
DatabasePageManagerCache.principalPropertiesCache.removeQuiet(principalKey); DatabasePageManagerCache.principalPropertiesPathCache.removeQuiet(principalKey); break;
DatabasePageManagerCache.propertiesCache.removeQuiet(fragmentKey); DatabasePageManagerCache.propertiesPathCache.removeQuiet(fragmentKey);
pathCache.removeQuiet(remove); propertiesPathCache.removeQuiet(remove); principalPropertiesPathCache.removeQuiet(remove);
/** * @see org.apache.jetspeed.prefs.PreferencesProvider#storeNode(org.apache.jetspeed.prefs.om.Node) */ public void storeNode(Node node) { NodeImplProxy hit = null; if (node instanceof NodeImplProxy) { hit = (NodeImplProxy)node; } else { //System.out.println("WARNING!!!!STORE NODE!!!!!!!!!!!! - Illegal Node element passed"); hit = new NodeImplProxy(node); } NodeCache key = new NodeCache(hit); try { getPersistenceBrokerTemplate().store(hit.getNode()); // avoid racing condition with the db and with cluster notification // do the db first preferenceCache.remove(key.getCacheKey()); // not sure we should actually do that, could also just update the node addToCache(key); } catch (Exception e) { preferenceCache.removeQuiet(key.getCacheKey()); // remove problematic nodes from cache throw new RuntimeException("Failed to store node of type " + node.getNodeType() + " for the path " + node.getFullPath() + ". " + e.toString(), e); } }
if (preferenceCache.removeQuiet(key.getCacheKey()))