org.cometd.server
Class CometdServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by org.cometd.server.CometdServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class CometdServlet
extends javax.servlet.GenericServlet

The cometd Servlet.

The cometd Servlet maps HTTP requests to the HttpTransport of a BayeuxServerImpl instance. If a BayeuxServerImpl instance is discovered in the BayeuxServer.ATTRIBUTE servlet context attribute, then it is used, otherwise a new instance is created and the initializeBayeux(BayeuxServerImpl) method called.

See Also:
Serialized Form

Field Summary
static int CONFIG_LEVEL
           
static int DEBUG_LEVEL
           
static int INFO_LEVEL
           
 
Constructor Summary
CometdServlet()
           
 
Method Summary
 void destroy()
           
 BayeuxServerImpl getBayeux()
           
 void init()
           
protected  void initializeBayeux(BayeuxServerImpl bayeux)
          Initialise the BayeuxServer.
protected  void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void service(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp)
           
protected  void serviceOptions(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
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

CONFIG_LEVEL

public static final int CONFIG_LEVEL
See Also:
Constant Field Values

INFO_LEVEL

public static final int INFO_LEVEL
See Also:
Constant Field Values

DEBUG_LEVEL

public static final int DEBUG_LEVEL
See Also:
Constant Field Values
Constructor Detail

CometdServlet

public CometdServlet()
Method Detail

getBayeux

public BayeuxServerImpl getBayeux()

initializeBayeux

protected void initializeBayeux(BayeuxServerImpl bayeux)
Initialise the BayeuxServer. Called by init() if a bayeux server is constructed by this servlet. The default implementation calls BayeuxServerImpl.initializeDefaultTransports().

Parameters:
bayeux -

init

public void init()
          throws javax.servlet.ServletException
Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

service

public void service(javax.servlet.ServletRequest req,
                    javax.servlet.ServletResponse resp)
             throws javax.servlet.ServletException,
                    IOException
Specified by:
service in interface javax.servlet.Servlet
Specified by:
service in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException
IOException

service

protected void service(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws javax.servlet.ServletException,
                       IOException
Throws:
javax.servlet.ServletException
IOException

serviceOptions

protected void serviceOptions(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet
See Also:
GenericServlet.destroy()


Copyright © 2008-2010 Dojo Foundation. All Rights Reserved.