Examples of LazyExpiringCacheEntry


Examples of org.apache.roller.util.cache.LazyExpiringCacheEntry

                    lastExpiration = lastExpirationDate.getTime();
            } else {
                lastExpiration = this.mainLastExpiredDate.getTime();
            }
           
            LazyExpiringCacheEntry entry =
                    (LazyExpiringCacheEntry) this.mCache.get(key);
            if(entry != null) {
                updateTime = (Date) entry.getValue(lastExpiration);
               
                if(updateTime == null)
                    mLogger.debug("HIT-INVALID "+key);
            }
           
            if (updateTime == null) {
                mLogger.debug("MISS "+key);
               
                if(feedRequest.getWeblogHandle() != null) {
                    Roller roller = RollerFactory.getRoller();
                    UserManager umgr = roller.getUserManager();
                    WeblogManager wmgr = roller.getWeblogManager();
                   
                    updateTime = wmgr.getWeblogLastPublishTime(
                            umgr.getWebsiteByHandle(feedRequest.getWeblogHandle()),
                            feedRequest.getWeblogCategory());
                   
                    this.mCache.put(key, new LazyExpiringCacheEntry(updateTime));
                   
                } else {
                    this.mCache.put(key, new LazyExpiringCacheEntry(new Date()));
                }
               
            } else {
                mLogger.debug("HIT "+key);
            }
View Full Code Here

Examples of org.apache.roller.util.cache.LazyExpiringCacheEntry

            Date lastExpirationDate =
                    (Date) CacheManager.getLastExpiredDate(pageRequest.getWeblogHandle());
            if(lastExpirationDate != null)
                lastExpiration = lastExpirationDate.getTime();
           
            LazyExpiringCacheEntry entry =
                    (LazyExpiringCacheEntry) this.mCache.get(key);
            if(entry != null) {
                updateTime = (Date) entry.getValue(lastExpiration);
               
                if(updateTime == null)
                    mLogger.debug("HIT-INVALID "+key);
            }
           
            if (updateTime == null) {
                mLogger.debug("MISS "+key);
               
                if(pageRequest.getWeblogHandle() != null) {
                    // just set updateTime to now
                    updateTime = new Date();
                    this.mCache.put(key, new LazyExpiringCacheEntry(updateTime));
                }
               
            } else {
                mLogger.debug("HIT "+key);
            }
View Full Code Here

Examples of org.apache.roller.util.cache.LazyExpiringCacheEntry

                Date lastExpirationDate =
                        (Date) CacheManager.getLastExpiredDate(pageRequest.getWeblogHandle());
                if(lastExpirationDate != null)
                    lastExpiration = lastExpirationDate.getTime();
               
                LazyExpiringCacheEntry entry =
                        (LazyExpiringCacheEntry) this.mCache.get(key);
                if(entry != null) {
                    respContent = (ResponseContent) entry.getValue(lastExpiration);
                   
                    if(respContent == null)
                        mLogger.debug("HIT-INVALID "+key);
                }
            }
           
            if (respContent == null) {
               
                mLogger.debug("MISS "+key);
                this.misses++;
               
                CacheHttpServletResponseWrapper cacheResponse =
                        new CacheHttpServletResponseWrapper(response);
               
                chain.doFilter(request, cacheResponse);
               
                cacheResponse.flushBuffer();
               
                // Store as the cache content the result of the response
                // if no exception was noted by content generator.
                if (request.getAttribute("DisplayException") == null) {
                    ResponseContent rc = cacheResponse.getContent();
                   
                    // only cache if this is not a logged in user?
                    if (!this.excludeOwnerPages || !pageRequest.isLoggedIn()) {
                        if (rc != null && rc.getSize() > 0) {
                            this.mCache.put(key, new LazyExpiringCacheEntry(rc));
                        } else {
                            mLogger.debug("Not caching zero length content for key: " + key);
                        }
                    } else {
                        mLogger.debug("SKIPPED "+key);
View Full Code Here

Examples of org.apache.roller.util.cache.LazyExpiringCacheEntry

                    lastExpiration = lastExpirationDate.getTime();
            } else {
                lastExpiration = this.mainLastExpiredDate.getTime();
            }
           
            LazyExpiringCacheEntry entry =
                    (LazyExpiringCacheEntry) this.mCache.get(key);
            if(entry != null) {
                respContent = (ResponseContent) entry.getValue(lastExpiration);
               
                if(respContent == null)
                    mLogger.debug("HIT-INVALID "+key);
            }
               
            if (respContent == null) {
               
                mLogger.debug("MISS "+key);
                this.misses++;
               
                CacheHttpServletResponseWrapper cacheResponse =
                        new CacheHttpServletResponseWrapper(response);
               
                chain.doFilter(request, cacheResponse);
               
                cacheResponse.flushBuffer();
               
                // only cache if there wasn't an exception
                if (request.getAttribute("DisplayException") == null) {
                    ResponseContent rc = cacheResponse.getContent();
                   
                    this.mCache.put(key, new LazyExpiringCacheEntry(rc));
                } else {
                    // it is expected that whoever caught this display exception
                    // is the one who reported it to the logs
                    mLogger.debug("Display exception "+key);
                }
View Full Code Here

Examples of org.apache.roller.util.cache.LazyExpiringCacheEntry

        if(!cacheEnabled)
            return null;
       
        Object entry = null;
       
        LazyExpiringCacheEntry lazyEntry =
                (LazyExpiringCacheEntry) this.contentCache.get(key);
        if(lazyEntry != null) {
            entry = lazyEntry.getValue(lastModified);
           
            if(entry != null) {
                log.debug("HIT "+key);
            } else {
                log.debug("HIT-EXPIRED "+key);
View Full Code Here

Examples of org.apache.roller.util.cache.LazyExpiringCacheEntry

    public void put(String key, Object value) {
       
        if(!cacheEnabled)
            return;
       
        contentCache.put(key, new LazyExpiringCacheEntry(value));
        log.debug("PUT "+key);
    }
View Full Code Here

Examples of org.apache.roller.util.cache.LazyExpiringCacheEntry

        if(!cacheEnabled)
            return null;
       
        Object entry = null;
       
        LazyExpiringCacheEntry lazyEntry =
                (LazyExpiringCacheEntry) this.contentCache.get(key);
        if(lazyEntry != null) {
            entry = lazyEntry.getValue(lastModified);
           
            if(entry != null) {
                log.debug("HIT "+key);
            } else {
                log.debug("HIT-EXPIRED "+key);
View Full Code Here

Examples of org.apache.roller.util.cache.LazyExpiringCacheEntry

    public void put(String key, Object value) {
       
        if(!cacheEnabled)
            return;
       
        contentCache.put(key, new LazyExpiringCacheEntry(value));
        log.debug("PUT "+key);
    }
View Full Code Here

Examples of org.apache.roller.util.cache.LazyExpiringCacheEntry

        if(!cacheEnabled)
            return null;
       
        Object entry = null;
       
        LazyExpiringCacheEntry lazyEntry =
                (LazyExpiringCacheEntry) this.contentCache.get(key);
        if(lazyEntry != null) {
            entry = lazyEntry.getValue(lastModified);
           
            if(entry != null) {
                log.debug("HIT "+key);
            } else {
                log.debug("HIT-EXPIRED "+key);
View Full Code Here

Examples of org.apache.roller.util.cache.LazyExpiringCacheEntry

    public void put(String key, Object value) {
       
        if(!cacheEnabled)
            return;
       
        contentCache.put(key, new LazyExpiringCacheEntry(value));
        log.debug("PUT "+key);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.