org.granite.gravity.tomcat
Class AbstractCometProcessor

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.granite.gravity.AbstractGravityServlet
              extended by org.granite.gravity.tomcat.AbstractCometProcessor
All Implemented Interfaces:
Serializable, Servlet, ServletConfig, CometProcessor
Direct Known Subclasses:
GravityTomcatServlet

public abstract class AbstractCometProcessor
extends AbstractGravityServlet
implements CometProcessor

Author:
Franck WOLFF
See Also:
Serialized Form

Constructor Summary
AbstractCometProcessor()
           
 
Method Summary
protected  void begin(CometEvent event)
           
abstract  CometIO createCometIO()
           
protected  void end(CometEvent event)
           
protected  void error(CometEvent event)
           
 void event(CometEvent event)
           
abstract  boolean handleEnd(CometEvent event)
           
abstract  boolean handleError(CometEvent event)
           
abstract  boolean handleRequest(CometEvent event, InputStream content)
           
 void init(ServletConfig config)
           
protected  void read(CometEvent event)
           
protected  void service(HttpServletRequest request, HttpServletResponse response)
           
 
Methods inherited from class org.granite.gravity.AbstractGravityServlet
cleanupRequest, deserialize, deserialize, doDelete, doGet, doHead, doOptions, doPut, doTrace, getConnectMessage, getLongPollingTimeout, init, initializeRequest, removeConnectMessage, serialize, setConnectMessage
 
Methods inherited from class javax.servlet.http.HttpServlet
doPost, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, 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
 

Constructor Detail

AbstractCometProcessor

public AbstractCometProcessor()
Method Detail

init

public void init(ServletConfig config)
          throws ServletException
Specified by:
init in interface Servlet
Overrides:
init in class GenericServlet
Throws:
ServletException

createCometIO

public abstract CometIO createCometIO()

handleRequest

public abstract boolean handleRequest(CometEvent event,
                                      InputStream content)
                               throws IOException,
                                      ServletException
Throws:
IOException
ServletException

handleEnd

public abstract boolean handleEnd(CometEvent event)
                           throws IOException,
                                  ServletException
Throws:
IOException
ServletException

handleError

public abstract boolean handleError(CometEvent event)
                             throws IOException,
                                    ServletException
Throws:
IOException
ServletException

event

public void event(CometEvent event)
           throws IOException,
                  ServletException
Specified by:
event in interface CometProcessor
Throws:
IOException
ServletException

begin

protected void begin(CometEvent event)
              throws IOException,
                     ServletException
Throws:
IOException
ServletException

read

protected void read(CometEvent event)

end

protected void end(CometEvent event)
            throws IOException,
                   ServletException
Throws:
IOException
ServletException

error

protected void error(CometEvent event)
              throws IOException,
                     ServletException
Throws:
IOException
ServletException

service

protected void service(HttpServletRequest request,
                       HttpServletResponse response)
                throws IOException,
                       ServletException
Overrides:
service in class HttpServlet
Throws:
IOException
ServletException