com.andreani.xtol.node
Class TolerantServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--com.andreani.xtol.node.TolerantServlet
All Implemented Interfaces:
EventListener, Serializable, ServiceIDListener, Servlet, ServletConfig

public class TolerantServlet
extends HttpServlet
implements ServiceIDListener

This class realize the agent that joins the network and offers to it its services. Is is a simple Servlet that uses its init() method to make it visible as service into the network. A developer who wants to load balance accesses to his server and make it fail tolerant must subclass this class and call super.init() and super.doGet() at the beginning of these local methods.

Version:
1.0
Author:
Stefano Andreani
See Also:
Serialized Form

Field Summary
protected  Category cat
           
 
Constructor Summary
TolerantServlet()
           
 
Method Summary
 void destroy()
           
 void doGet(HttpServletRequest req, HttpServletResponse resp)
          Always invoke super.doGet(req,resp) as first operation when you override this method.
 void init(ServletConfig sconf)
          Registers itself into the lookup service.
 void rebuildSession(String globsessid, HttpServletRequest req)
          This method create a new HttpSession retrieving session data from a SessionSpace.
 void serviceIDNotify(ServiceID id)
          Debbugging purpose
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cat

protected Category cat
Constructor Detail

TolerantServlet

public TolerantServlet()
Method Detail

init

public void init(ServletConfig sconf)
Registers itself into the lookup service. Always invoke super.init(ServletConfig) as first operation when you override this method.
Overrides:
init in class GenericServlet

destroy

public void destroy()
Overrides:
destroy in class GenericServlet

doGet

public void doGet(HttpServletRequest req,
                  HttpServletResponse resp)
           throws ServletException,
                  IOException
Always invoke super.doGet(req,resp) as first operation when you override this method.
Overrides:
doGet in class HttpServlet

rebuildSession

public void rebuildSession(String globsessid,
                           HttpServletRequest req)
This method create a new HttpSession retrieving session data from a SessionSpace. It is usually used if the session server failed.

serviceIDNotify

public void serviceIDNotify(ServiceID id)
Debbugging purpose
Specified by:
serviceIDNotify in interface ServiceIDListener


Copyright © 2001 Stefano Andreani - No Rights Reserved ;-)