public void cache(Identity oid, Object obj) { cacheAdd(oid, obj); } public synchronized static void cacheAdd(Identity oid, Object obj)
public void clear() { cacheClear(); } public synchronized static void cacheClear()
public Object lookup(Identity oid) { return cacheLookup(oid); } public synchronized static Object cacheLookup(Identity oid)
public void remove(Identity oid) { cacheRemove(oid); } /**
RegistryApplicationCache.cacheRemoveQuiet((String) key, (RegistryCacheObjectWrapper)element); if (listeners != null && !listeners.isEmpty())
public PersistenceBrokerPortletRegistry(String repositoryPath, JetspeedCache applicationOidCache, JetspeedCache portletOidCache, JetspeedCache applicationNameCache, JetspeedCache portletNameCache, PortletPreferencesProvider preferenceService, SearchEngine search) { super(repositoryPath); this.applicationOidCache = applicationOidCache; this.portletOidCache = portletOidCache; this.applicationNameCache = applicationNameCache; this.portletNameCache = portletNameCache; PortletApplicationProxyImpl.setRegistry(this); RegistryApplicationCache.cacheInit(this, applicationOidCache, applicationNameCache, listeners); RegistryPortletCache.cacheInit(this, portletOidCache, portletNameCache, listeners); this.applicationNameCache.addEventListener(this, false); this.portletNameCache.addEventListener(this, false); this.preferenceService = preferenceService; this.searchEngine = search; }
/** * 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); } } }
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()); }