protected void setCachedConfiguration( String name, String type, Properties props ) { if ( decorationConfigurationCache == null ) { if ( type.equals( ContentFragment.PORTLET ) ) { this.portletDecoratorProperties.put( name, props ); } else { 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 ); } } protected String getCachedConfigurationKey( String type, String name )
private void setCachedContent( String cacheKey, String content ) { CacheElement cachedElement = desktopContentCache.createElement( cacheKey, content ); cachedElement.setTimeToIdleSeconds(desktopContentCache.getTimeToIdleSeconds()); cachedElement.setTimeToLiveSeconds(desktopContentCache.getTimeToLiveSeconds()); desktopContentCache.put( cachedElement ); }
protected void addToCache(NodeCache content) { CacheElement cachedElement = preferenceCache.createElement(content.getCacheKey(), content); cachedElement.setTimeToIdleSeconds(preferenceCache.getTimeToIdleSeconds()); cachedElement.setTimeToLiveSeconds(preferenceCache.getTimeToLiveSeconds()); preferenceCache.put(cachedElement); }
protected void addToCache(RequestContext context, 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); context.getPortalURL().getNavigationalState().registerPortletContentCachedForPublicRenderParameters(context, content); }