public void putIntoService(List<String> fullPortletNames) { for (String fullName : fullPortletNames) { trackingCache.remove(fullName); } }
/** * 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; }
/** * @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); } }
public void completeAuthenticationEvent(String token) { cache.remove(token); }
public void notifyElementRemoved(JetspeedCache cache, boolean local, Object key, Object element) { DatabasePageManagerFragmentKeyCacheObject cacheObject = (DatabasePageManagerFragmentKeyCacheObject)element; // remove cache object from local properties cache String fragmentKey = ((cacheObject != null) ? cacheObject.getFragmentKey() : (String)key); if (fragmentKey != null) { // parse key to extract fragment id int fragmentId = getFragmentIdFromFragmentKey(fragmentKey); // remove cached objects synchronized (DatabasePageManagerCache.class) { // remove principal fragment property list caches that have fragment properties if (fragmentId > 0) { clearPrincipalPropertiesCache(fragmentId); } // remove from fragment property list cache DatabasePageManagerCache.propertiesCache.remove(fragmentKey); } } } }, false);
/** * Remove principal fragment property list from local and remote caches. * * @param principalKey principal key fragment property list */ public synchronized static void principalFragmentPropertyListCacheRemove(String principalKey) { // remove fragment properties list cached locally and // notify remote caches by principal key if (principalKey != null) { principalPropertiesCache.remove(principalKey); boolean removed = principalPropertiesPathCache.remove(principalKey); // if a remove was not successful from the path cache, update // notification to distributed peers was not performed; // for updates of objects evicted from the cache, this is // problematic: put into path cache and remove a second time // to force notification if (!removed) { principalPropertiesPathCache.put(principalPropertiesPathCache.createElement(principalKey, new DatabasePageManagerPrincipalKeyCacheObject(principalKey))); principalPropertiesPathCache.remove(principalKey); } } }
/** * Remove fragment property list from local and remote caches. * * @param fragmentKey fragment key for fragment property list */ public synchronized static void fragmentPropertyListCacheRemove(String fragmentKey) { // remove fragment properties list cached locally by key // and notify remote caches by fragment key if (fragmentKey != null) { propertiesCache.remove(fragmentKey); boolean removed = propertiesPathCache.remove(fragmentKey); // if a remove was not successful from the path cache, update // notification to distributed peers was not performed; // for updates of objects evicted from the cache, this is // problematic: put into path cache and remove a second time // to force notification if (!removed) { propertiesPathCache.put(propertiesPathCache.createElement(fragmentKey, new DatabasePageManagerFragmentKeyCacheObject(fragmentKey))); propertiesPathCache.remove(fragmentKey); } } }
/** * cacheRemove * * Remove identified object from object and node caches. * * @param oid object identity */ public synchronized static void cacheRemove(Identity oid) { PortletApplication pd = (PortletApplication)cacheLookup(oid); if (pd == null) return; oidCache.remove(oid); nameCache.remove(pd.getName()); if (listeners != null) { for (int ix=0; ix < listeners.size(); ix++) { RegistryEventListener listener = (RegistryEventListener)listeners.get(ix); listener.applicationRemoved(pd); } } }
/** * cacheRemove * * Remove identified object from object and node caches. * * @param oid object identity */ public synchronized static void cacheRemove(Identity oid) { PortletDefinition pd = (PortletDefinition)cacheLookup(oid); if (pd == null) return; oidCache.remove(oid); nameCache.remove(pd.getUniqueName()); if (listeners != null) { for (int ix=0; ix < listeners.size(); ix++) { RegistryEventListener listener = (RegistryEventListener)listeners.get(ix); listener.portletRemoved(pd); } } }
public synchronized static void cacheAdd(Identity oid, Object obj) { oidCache.remove(oid); CacheElement entry = new EhCacheElementImpl(oid, obj); oidCache.put(entry); PortletApplication pa = (PortletApplication)obj; DistributedCacheObject wrapper = new RegistryCacheObjectWrapper(oid, pa.getName()); nameCache.remove(pa.getName()); CacheElement nameEntry = nameCache.createElement(pa.getName(), wrapper); nameCache.put(nameEntry); if (listeners != null) { for (int ix=0; ix < listeners.size(); ix++) { RegistryEventListener listener = (RegistryEventListener)listeners.get(ix); listener.applicationUpdated((PortletApplication)obj); } } }
public synchronized static void cacheAdd(Identity oid, Object obj) { oidCache.remove(oid); PortletDefinition pd = (PortletDefinition)obj; if (pd.getApplication() == null) { return; } CacheElement entry = new EhCacheElementImpl(oid, obj); oidCache.put(entry); DistributedCacheObject wrapper = new RegistryCacheObjectWrapper(oid, pd.getUniqueName()); nameCache.remove(pd.getUniqueName()); CacheElement nameEntry = nameCache.createElement(pd.getUniqueName(), wrapper); nameCache.put(nameEntry); if (listeners != null) { for (int ix=0; ix < listeners.size(); ix++) { RegistryEventListener listener = (RegistryEventListener)listeners.get(ix); listener.portletUpdated((PortletDefinition)obj); } } }
/** * Jetspeed: PortletPreferencesProvider */ public void storeEntityPreferences(Map<String, PortletPreference> map, PortletWindow window) throws PreferencesException { for (Entry<String, PortletPreference> entry : map.entrySet()) { org.apache.jetspeed.om.portlet.PortletDefinition pd = window.getPortletDefinition(); String entityId = window.getPortletEntityId(); String appName = pd.getApplication().getName(); String portletName = pd.getPortletName(); String entityCacheKey = this.getEntityPreferenceKey(appName, portletName, entityId); preferenceCache.remove(entityCacheKey); } try { ContentFragment fragment = window.getFragment(); fragment.updatePreferences(map); } catch (Exception e) { throw new PreferencesException(e); } }
/** * Jetspeed: PortletPreferencesProvider */ public void removeDefaults(PortletApplication app) { Criteria c = new Criteria(); c.addEqualTo(DTYPE, DISCRIMINATOR_PORTLET); c.addEqualTo(APPLICATION_NAME, app.getName()); QueryByCriteria query = QueryFactory.newQuery(DatabasePreference.class, c); getPersistenceBrokerTemplate().deleteByQuery(query); for (PortletDefinition pd : app.getPortlets()) { String defaultsCacheKey = getPortletPreferenceKey(pd.getApplication().getName(), pd.getPortletName()); preferenceCache.remove(defaultsCacheKey); } }
/** * Jetspeed: PortletPreferencesProvider */ public void removeDefaults(org.apache.jetspeed.om.portlet.PortletDefinition pd) { Criteria c = new Criteria(); c.addEqualTo(DTYPE, DISCRIMINATOR_PORTLET); c.addEqualTo(APPLICATION_NAME, pd.getApplication().getName()); c.addEqualTo(PORTLET_NAME, pd.getPortletName()); QueryByCriteria query = QueryFactory.newQuery(DatabasePreference.class, c); getPersistenceBrokerTemplate().deleteByQuery(query); String defaultsCacheKey = getPortletPreferenceKey(pd.getApplication().getName(), pd.getPortletName()); preferenceCache.remove(defaultsCacheKey); }