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()); }
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()); }
public PortletApplication getPortletApplication(String name, boolean fromCache) { if (fromCache) { CacheElement cacheElement = applicationNameCache.get(name); if (cacheElement != null) { cacheElement = applicationOidCache.get(((RegistryCacheObjectWrapper)cacheElement.getContent()).getId()); if (cacheElement != null) { return (PortletApplication)cacheElement.getContent(); } } } Criteria c = new Criteria(); c.addEqualTo("name", name); PortletApplication app = (PortletApplication) getPersistenceBrokerTemplate().getObjectByQuery( QueryFactory.newQuery(PortletApplicationDefinitionImpl.class, c)); postLoad(app); return app; }
public PortletDefinition getPortletDefinitionByUniqueName( String name, boolean fromCache ) { if (fromCache) { CacheElement cacheElement = portletNameCache.get(name); if (cacheElement != null) { cacheElement = portletOidCache.get(((RegistryCacheObjectWrapper)cacheElement.getContent()).getId()); if (cacheElement != null) { return (PortletDefinition)cacheElement.getContent(); } } } String appName = PortletRegistryHelper.parseAppName(name); String portletName = PortletRegistryHelper.parsePortletName(name); Criteria c = new Criteria(); c.addEqualTo("app.name", appName); c.addEqualTo("portletName", portletName); PortletDefinition def = (PortletDefinition) getPersistenceBrokerTemplate().getObjectByQuery( QueryFactory.newQuery(PortletDefinitionImpl.class, c)); if (def != null && def.getApplication() == null) { final String msg = "getPortletDefinitionByIdentifier() returned a PortletDefinition that has no parent PortletApplication."; throw new IllegalStateException(msg); } postLoad(def); return def; }