Package org.apache.roller.presentation.util

Examples of org.apache.roller.presentation.util.ResponseContent


            return;
        }
       
       
        try {
            ResponseContent respContent = null;
            if(!this.excludeOwnerPages || prince == null) {
                respContent = (ResponseContent) this.mCache.get(key);
            }
           
            if(respContent == null) {

                mLogger.debug("MISS "+key);
                this.misses++;
               
                CacheHttpServletResponseWrapper cacheResponse =
                        new CacheHttpServletResponseWrapper(response);
               
                chain.doFilter(request, cacheResponse);
               
                cacheResponse.flushBuffer();
               
                // only cache if we didn't get an exception
                if (request.getAttribute("DisplayException") == null) {
                    ResponseContent rc = cacheResponse.getContent();
                   
                    // only cache if this is not a logged in user?
                    if(!this.excludeOwnerPages || prince == null) {
                        this.mCache.put(key, rc);
                    } else {
View Full Code Here


        }
       
        String key = "planetCache:"+this.generateKey(planetRequest);
       
        try {
            ResponseContent respContent = null;
            if(!this.excludeOwnerPages || !planetRequest.isLoggedIn()) {
                respContent = (ResponseContent) this.mCache.get(key);
            }
           
            if(respContent == null) {

                mLogger.debug("MISS "+key);
                this.misses++;
               
                CacheHttpServletResponseWrapper cacheResponse =
                        new CacheHttpServletResponseWrapper(response);
               
                chain.doFilter(request, cacheResponse);
               
                cacheResponse.flushBuffer();
               
                // only cache if we didn't get an exception
                if (request.getAttribute("DisplayException") == null) {
                    ResponseContent rc = cacheResponse.getContent();
                   
                    // only cache if this is not a logged in user?
                    if(!this.excludeOwnerPages || !planetRequest.isLoggedIn()) {
                        this.mCache.put(key, rc);
                    } else {
View Full Code Here

        }
       
        String key = this.CACHE_ID+":"+this.generateKey(pageRequest);
       
        try {
            ResponseContent respContent = null;
            if(!this.excludeOwnerPages || !pageRequest.isLoggedIn()) {
                // we need the last expiration time for the given weblog
                long lastExpiration = 0;
                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 {
View Full Code Here

        }
       
        String key = this.CACHE_ID+":"+this.generateKey(feedRequest);
       
        try {
            ResponseContent respContent = null;
            long lastExpiration = 0;
           
            // first, we need to determine the last time the specified feed was expired.
            // if this is a weblog specific feed then ask the CacheManager for
            // the last expired time of the weblog.  otherwise this is a main feed and we
            // keep that last expired time ourselves
            if(feedRequest.getWeblogHandle() != null) {
                Date lastExpirationDate =
                        (Date) CacheManager.getLastExpiredDate(feedRequest.getWeblogHandle());
                if(lastExpirationDate != null)
                    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
View Full Code Here

TOP

Related Classes of org.apache.roller.presentation.util.ResponseContent

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.