com.arsdigita.caching
Class CacheServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bycom.arsdigita.caching.CacheServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class CacheServlet
extends javax.servlet.http.HttpServlet

A simple servlet which accepts the cache notifications issued by other webserver to implement coherent caching. Since there can be any number of webservers attached to the same database instance, we must make sure that caches among different webservers contain either the same, consistent value for a particular cache entry, or no value at all.

Whenever a CacheTable.put(String,Object) is invoked, a HTTP request is sent to all the other JVMs running this service, (except the current server of course).

The HTTP notification for newly added cache entry carries the hashcode of the new entry, so that the peer caches can decide whether the entry they already have (if at all) is outdated or not. For CacheTable.remove(String) invocations, no hash code is produced, and peer caches will remove this item unconditionally.

Version:
$Revision: #18 $ $DateTime: 2004/04/07 16:07:11 $
Author:
Matthew Booth, Sebastian Skracic
See Also:
Serialized Form

Constructor Summary
CacheServlet()
           
 
Method Summary
protected  void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          This is executed when foreign server asked us to drop an entry from our cache.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheServlet

public CacheServlet()
Method Detail

doGet

protected void doGet(javax.servlet.http.HttpServletRequest req,
                     javax.servlet.http.HttpServletResponse res)
This is executed when foreign server asked us to drop an entry from our cache. Make sure that we don't end up in recursion.



Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC