to.etc.webapp.ajax.comet
Class GenericCometServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
to.etc.webapp.ajax.comet.GenericCometServlet
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
public class GenericCometServlet
- extends javax.servlet.http.HttpServlet
This is a generic Ajax Comet pattern servlet. It implements the
Comet pattern (http://www.ajaxian.com/archives/comet-a-new-approach-to-ajax-applications)
using a standard Servlet container. This implementation is unusable
for large amounts of clients due to thread and connection exthaustion on
the web server. The base interface implemented by this servlet is however
well suited to be implemented by different servlet containers that do
have asynchronous servlet implementations like Tomcat 6, Bea and Jetty.
See also:
http://blogs.webtide.com/gregw/2006/07/25/1153845234453.html
- Author:
- Frits Jalvingh
Created on Oct 25, 2006
- See Also:
- Serialized Form
Method Summary |
void |
destroy()
|
protected void |
doGet(javax.servlet.http.HttpServletRequest arg0,
javax.servlet.http.HttpServletResponse arg1)
|
protected void |
doPost(javax.servlet.http.HttpServletRequest arg0,
javax.servlet.http.HttpServletResponse arg1)
|
protected void |
handleException(java.lang.Exception x)
|
void |
init()
|
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, 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 |
GenericCometServlet
public GenericCometServlet()
init
public void init()
throws javax.servlet.ServletException
- Overrides:
init
in class javax.servlet.GenericServlet
- Throws:
javax.servlet.ServletException
doGet
protected void doGet(javax.servlet.http.HttpServletRequest arg0,
javax.servlet.http.HttpServletResponse arg1)
throws javax.servlet.ServletException,
java.io.IOException
- Overrides:
doGet
in class javax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
java.io.IOException
doPost
protected void doPost(javax.servlet.http.HttpServletRequest arg0,
javax.servlet.http.HttpServletResponse arg1)
throws javax.servlet.ServletException,
java.io.IOException
- Overrides:
doPost
in class javax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
java.io.IOException
handleException
protected void handleException(java.lang.Exception x)
throws javax.servlet.ServletException,
java.io.IOException
- Throws:
javax.servlet.ServletException
java.io.IOException
destroy
public void destroy()
- Specified by:
destroy
in interface javax.servlet.Servlet
- Overrides:
destroy
in class javax.servlet.GenericServlet