Package org.apache.jetspeed.cache

Examples of org.apache.jetspeed.cache.CacheElement


   
    public void invalidate(RequestContext context)
    {
        ContentPage page = context.getPage();
        ContentCacheKey themeContentCacheKey = createCacheKey(context, page.getId());
        CacheElement themeCacheElem = get(themeContentCacheKey);
       
        if (themeCacheElem != null)
        {
            Theme theme = (Theme) themeCacheElem.getContent();
            theme.setInvalidated(true);
        }
    }
View Full Code Here


        preferenceCache.put(cachedElement);       
    }   
 
    private NodeCache getNode(String cacheKey)
    {
      CacheElement cachedElement = preferenceCache.get(cacheKey);
        if (cachedElement != null)
         return (NodeCache)cachedElement.getContent()
        return null;
    }
View Full Code Here

        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++;
                    }
                }
            }
View Full Code Here

        this.preloadEntities = preloadEntities;
    }
   
    protected void addToCache(NodeCache content)
    {
        CacheElement cachedElement = preferenceCache.createElement(content.getCacheKey(), content);
        cachedElement.setTimeToIdleSeconds(preferenceCache.getTimeToIdleSeconds());
        cachedElement.setTimeToLiveSeconds(preferenceCache.getTimeToLiveSeconds());
        preferenceCache.put(cachedElement);       
    }   
View Full Code Here

                                            PortletWindow portletWindow, int expiration,
                                            PortletDefinitionComposite portletDefinition)
        throws Exception
    {
        ContentCacheKey cacheKey = portletContentCache.createCacheKey(requestContext, fragment.getId());       
        CacheElement cachedElement = portletContentCache.get(cacheKey);
        if (cachedElement != null)
        {
            PortletContent portletContent = (PortletContent)cachedElement.getContent();           
            fragment.setPortletContent(portletContent);
            ContentDispatcherCtrl dispatcher = new ContentDispatcherImpl(portletContent);
            HttpServletRequest servletRequest = requestContext.getRequestForWindow(portletWindow);

            this.addTitleService.setDynamicTitle(portletWindow, servletRequest, dispatcher.getPortletContent(fragment).getTitle());
View Full Code Here

        return true;
    }
    protected void addToCache(PortletContent content)
    {
        CacheElement cachedElement = portletContentCache.createElement(content.getCacheKey(), content);
        if (content.getExpiration() == -1)
        {
            cachedElement.setTimeToIdleSeconds(portletContentCache.getTimeToIdleSeconds());
            cachedElement.setTimeToLiveSeconds(portletContentCache.getTimeToLiveSeconds());
        }
        else
        {      
            cachedElement.setTimeToIdleSeconds(content.getExpiration());
            cachedElement.setTimeToLiveSeconds(content.getExpiration());
        }
        portletContentCache.put(cachedElement);       
    }   
View Full Code Here

        else
        {
          return (Properties)this.layoutDecoratorProperties.get( name );
        }
      }
      CacheElement cachedElement = decorationConfigurationCache.get( getCachedConfigurationKey( type, name ) );
        if (cachedElement != null)
          return (Properties)cachedElement.getContent()
        return null;
    }
View Full Code Here

          this.layoutDecoratorProperties.put( name, props );
        }
      }
      else
      {
        CacheElement cachedElement = decorationConfigurationCache.createElement( getCachedConfigurationKey( type, name ), props );
        cachedElement.setTimeToIdleSeconds(decorationConfigurationCache.getTimeToIdleSeconds());
        cachedElement.setTimeToLiveSeconds(decorationConfigurationCache.getTimeToLiveSeconds());
        decorationConfigurationCache.put( cachedElement );
      }
    }
View Full Code Here

        this.preferenceCache = preferenceCache;
    }

    protected void addToCache(NodeCache content)
    {
        CacheElement cachedElement = preferenceCache.createElement(content.getCacheKey(), content);
        cachedElement.setTimeToIdleSeconds(preferenceCache.getTimeToIdleSeconds());
        cachedElement.setTimeToLiveSeconds(preferenceCache.getTimeToLiveSeconds());
        preferenceCache.put(cachedElement);       
    }   
View Full Code Here

        preferenceCache.put(cachedElement);       
    }   
 
    private NodeCache getNode(String cacheKey)
    {
      CacheElement cachedElement = preferenceCache.get(cacheKey);
        if (cachedElement != null)
         return (NodeCache)cachedElement.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.