logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

roller/src/org/roller/presentation/caching CommonsPageCache.java,1.10,1.11: msg#00150

Subject: roller/src/org/roller/presentation/caching CommonsPageCache.java,1.10,1.11
Update of /cvsroot/roller/roller/src/org/roller/presentation/caching
In directory sc8-pr-cvs1:/tmp/cvs-serv16587/src/org/roller/presentation/caching

Modified Files:
        CommonsPageCache.java 
Log Message:
Added Resin specific transformations to enable CommonsPageCache for use in 
caching /page and /rss.

Index: CommonsPageCache.java
===================================================================
RCS file: 
/cvsroot/roller/roller/src/org/roller/presentation/caching/CommonsPageCache.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** CommonsPageCache.java       14 Mar 2003 03:25:41 -0000      1.10
--- CommonsPageCache.java       16 Mar 2003 05:13:39 -0000      1.11
***************
*** 43,49 ****
  public class CommonsPageCache implements FilterHandler
  {
!     private static Log mLogger = 
          LogFactory.getFactory().getInstance(CommonsPageCache.class);
!         
      private static final String CACHENAME = "PageCache";
  
--- 43,49 ----
  public class CommonsPageCache implements FilterHandler
  {
!     private static Log mLogger =
          LogFactory.getFactory().getInstance(CommonsPageCache.class);
! 
      private static final String CACHENAME = "PageCache";
  
***************
*** 62,66 ****
       */
      private int  mTime = 60 * 60 * 1000;
!     
  
      public void flushCache(HttpServletRequest req)
--- 62,66 ----
       */
      private int  mTime = 60 * 60 * 1000;
! 
  
      public void flushCache(HttpServletRequest req)
***************
*** 79,83 ****
  
      /**
!      * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, 
       * javax.servlet.ServletResponse, javax.servlet.FilterChain)
       */
--- 79,83 ----
  
      /**
!      * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest,
       * javax.servlet.ServletResponse, javax.servlet.FilterChain)
       */
***************
*** 92,96 ****
          HttpServletResponse response = (HttpServletResponse) resp;
  
!         RollerRequest rreq = RollerRequest.getRollerRequest(request);        
          String username = "unknown";
          if ( rreq.getUser() == null )
--- 92,96 ----
          HttpServletResponse response = (HttpServletResponse) resp;
  
!         RollerRequest rreq = RollerRequest.getRollerRequest(request);
          String username = "unknown";
          if ( rreq.getUser() == null )
***************
*** 102,110 ****
              username = rreq.getUser().getUserName();
          }
!         String catname = 
              request.getParameter(RollerRequest.WEBLOGCATEGORYNAME_KEY);
  
          //--------------------------------
!         // First check if-modified-since header        
          Date updateTime = null;
          try
--- 102,110 ----
              username = rreq.getUser().getUserName();
          }
!         String catname =
              request.getParameter(RollerRequest.WEBLOGCATEGORYNAME_KEY);
  
          //--------------------------------
!         // First check if-modified-since header
          Date updateTime = null;
          try
***************
*** 116,121 ****
          {
              mLogger.error("Determining last publish time;");
!         }            
!         long since = 
              ((HttpServletRequest)request).getDateHeader("If-Modified-Since");
          if ( since != -1 && updateTime != null )
--- 116,121 ----
          {
              mLogger.error("Determining last publish time;");
!         }
!         long since =
              ((HttpServletRequest)request).getDateHeader("If-Modified-Since");
          if ( since != -1 && updateTime != null )
***************
*** 127,133 ****
                      HttpServletResponse.SC_NOT_MODIFIED);
                  return;
!             }                          
!         }        
!               
          // get a handle on the cache
          Cache cache = this.getCache();
--- 127,133 ----
                      HttpServletResponse.SC_NOT_MODIFIED);
                  return;
!             }
!         }
! 
          // get a handle on the cache
          Cache cache = this.getCache();
***************
*** 149,153 ****
  
          // put a wrapper around the Response
!         ByteArrayResponseWrapper myWrappedResp = 
              new ByteArrayResponseWrapper(response);
  
--- 149,153 ----
  
          // put a wrapper around the Response
!         ByteArrayResponseWrapper myWrappedResp =
              new ByteArrayResponseWrapper(response);
  
***************
*** 159,168 ****
  
          // unwrap the Response, sort of, not really.
!         ByteArrayOutputStreamWrapper newOut = 
              (ByteArrayOutputStreamWrapper) myWrappedResp.getOutputStream();
          ByteArrayOutputStream baStream = newOut.getByteArrayStream();
  
          // again, it wasn't cached
!         
          if (pageVal == null)
          {
--- 159,168 ----
  
          // unwrap the Response, sort of, not really.
!         ByteArrayOutputStreamWrapper newOut =
              (ByteArrayOutputStreamWrapper) myWrappedResp.getOutputStream();
          ByteArrayOutputStream baStream = newOut.getByteArrayStream();
  
          // again, it wasn't cached
! 
          if (pageVal == null)
          {
***************
*** 181,185 ****
       * Uses Commons Cache CacheConfig object to read a configuration file,
       * failing that creates one using the values from the Filter's 
initialization.
!      * 
      **/
      public synchronized Cache getCache()
--- 181,185 ----
       * Uses Commons Cache CacheConfig object to read a configuration file,
       * failing that creates one using the values from the Filter's 
initialization.
!      *
      **/
      public synchronized Cache getCache()
***************
*** 189,193 ****
              return CacheSingleton.getCache(CACHENAME);
          }
!         
          Cache cache = null;
          java.io.InputStream in = null;
--- 189,193 ----
              return CacheSingleton.getCache(CACHENAME);
          }
! 
          Cache cache = null;
          java.io.InputStream in = null;
***************
*** 205,209 ****
              mLogger.warn("Unable to load config file: " + fileName);
              cache = new SimpleCache(
!                 new MemoryStash( mMaxObjects ), 
                  new LRUEvictionPolicy(),
                  null,
--- 205,209 ----
              mLogger.warn("Unable to load config file: " + fileName);
              cache = new SimpleCache(
!                 new MemoryStash( mMaxObjects ),
                  new LRUEvictionPolicy(),
                  null,




-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en


<Prev in Thread] Current Thread [Next in Thread>