Package org.apache.jetspeed.cache

Examples of org.apache.jetspeed.cache.CacheElement


        {
            JetspeedPreferencesMap entityMap = null;
            String appName = pd.getApplication().getName();
            String portletName = pd.getPortletName();
            String entityCacheKey = this.getEntityPreferenceKey(appName, portletName, entityId);
            CacheElement cachedEntity = preferenceCache.get(entityCacheKey);       
            if (cachedEntity != null)
            {
                entityMap = (JetspeedPreferencesMap)cachedEntity.getContent();
            }           
            else
            {
                entityMap = (JetspeedPreferencesMap)retrieveEntityPreferences(window);               
            }
View Full Code Here


        String appName = window.getPortletDefinition().getApplication().getName();
        String portletName = window.getPortletDefinition().getPortletName();
        String entityId = window.getPortletEntityId();       
        String cacheKey = getUserPreferenceKey(appName, portletName, entityId, userName);
        // first search in cache       
        CacheElement cachedElement = preferenceCache.get(cacheKey);       
        if (cachedElement != null)
        {
            JetspeedPreferencesMap map = (JetspeedPreferencesMap)cachedElement.getContent();
            return map;
        }           
        // not found in cache, lookup in database
        JetspeedPreferencesMap map = new JetspeedPreferencesMap();
        Criteria c = new Criteria();
View Full Code Here

        }

        getPersistenceBrokerTemplate().store(dbPref);

        String defaultsCacheKey = getPortletPreferenceKey(appName, portletName);
        CacheElement cacheElement = preferenceCache.get(defaultsCacheKey);
        JetspeedPreferencesMap map = (cacheElement != null ? (JetspeedPreferencesMap) cacheElement.getContent() : new JetspeedPreferencesMap());
        map.put(preferenceName, new JetspeedPreferenceImpl(preferenceName, dbPref.getValues(), dbPref.isReadOnly()));
        preferenceCache.put(preferenceCache.createElement(defaultsCacheKey, map));
    }
View Full Code Here

        String appName = pd.getApplication().getName();
        String portletName = pd.getPortletName();       
        String defaultsCacheKey = getPortletPreferenceKey(appName, portletName);
        JetspeedPreferencesMap defaultsMap;        
        // first search in cache       
        CacheElement cachedDefaults = preferenceCache.get(defaultsCacheKey);
        if (cachedDefaults != null)
        {
            defaultsMap = (JetspeedPreferencesMap)cachedDefaults.getContent();
        }           
        else
        {
            // not found in cache, lookup in database
            JetspeedPreferencesMap map = new JetspeedPreferencesMap();
View Full Code Here

        JetspeedPreferencesMap userPreferences = new JetspeedPreferencesMap();
        String appName = portletdefinition.getApplication().getName();
        String portletName = portletdefinition.getPortletName();
       
        String userCacheKey = getUserPreferenceKey(appName, portletName,windowId, userName);
        CacheElement cachedDefaults = preferenceCache.get(userCacheKey);
        if (cachedDefaults != null)
        {
            userPreferences = (JetspeedPreferencesMap) cachedDefaults.getContent();
        }
        else
        {
            Criteria c = new Criteria();
            c.addEqualTo("dtype", DISCRIMINATOR_USER);
View Full Code Here

    public synchronized static Object cacheLookup(Identity oid)
    {
        if (oid != null)
        {
            // return valid object cached by oid
            CacheElement element = oidCache.get(oid);
            if (element != null)
            {
                return element.getContent();
            }
        }
        return null;
    }
View Full Code Here

                // remove notification to distributed peers was not
                // performed; this is problematic: put into path cache
                // and remove a second time to force
                if (!removed)
                {
                    CacheElement pathElement = pathCache.createElement(path, new DatabasePageManagerCacheObject(oid, path));
                    pathCache.put(pathElement);
                    pathCache.remove(path);
                }
            }
        }
View Full Code Here

    public synchronized static void cacheRemove(String path)
    {
        // remove from cache by path
        if (path != null)
        {
            CacheElement pathElement = pathCache.get(path);
            if (pathElement != null)
            {
                DatabasePageManagerCacheObject cacheObject = (DatabasePageManagerCacheObject)pathElement.getContent();
                // remove from caches; note that removes are
                // propagated to distributed caches
                oidCache.remove(cacheObject.getId());
                pathCache.remove(path);
            }
View Full Code Here

    public synchronized static DatabasePageManagerCachedFragmentPropertyList fragmentPropertyListCacheLookup(String fragmentKey)
    {
        // return fragment properties list cached locally by key
        if (fragmentKey != null)
        {
            CacheElement propertiesElement = propertiesCache.get(fragmentKey);
            if (propertiesElement != null)
            {
                return (DatabasePageManagerCachedFragmentPropertyList)propertiesElement.getContent();
            }
        }
        return null;
    }
View Full Code Here

    public synchronized static DatabasePageManagerCachedFragmentPropertyList principalFragmentPropertyListCacheLookup(String principalKey)
    {
        // return fragment properties list cached locally by key
        if (principalKey != null)
        {
            CacheElement propertiesElement = principalPropertiesCache.get(principalKey);
            if (propertiesElement != null)
            {
                return (DatabasePageManagerCachedFragmentPropertyList)propertiesElement.getContent();
            }
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.cache.CacheElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.