Class CometDServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.cometd.server.http.jakarta.CometDServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
,Serializable
- Direct Known Subclasses:
AnnotationCometDServlet
public class CometDServlet
extends jakarta.servlet.http.HttpServlet
The CometD Servlet maps HTTP requests to the AbstractHttpTransport
of a BayeuxServer
instance.
The BayeuxServer
instance is searched in the Servlet context under the
name specified by the "bayeuxServerContextAttributeName" option,
whose default is "org.cometd.bayeux".
If a BayeuxServer
instance is found, then it is used without further
configuration, otherwise a new BayeuxServer
instance is created and
configured using the init parameters of this Servlet.
- See Also:
-
Field Summary
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
void
init()
protected BayeuxServer
protected void
sendError
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, int code, Throwable failure) protected void
service
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) protected void
serviceOptions
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, init, service
Methods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log
-
Constructor Details
-
CometDServlet
public CometDServlet()
-
-
Method Details
-
init
public void init() throws jakarta.servlet.ServletException- Overrides:
init
in classjakarta.servlet.GenericServlet
- Throws:
jakarta.servlet.ServletException
-
getBayeuxServer
-
newBayeuxServer
-
service
protected void service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException - Overrides:
service
in classjakarta.servlet.http.HttpServlet
- Throws:
jakarta.servlet.ServletException
IOException
-
serviceOptions
protected void serviceOptions(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) -
sendError
protected void sendError(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, int code, Throwable failure) -
destroy
public void destroy()- Specified by:
destroy
in interfacejakarta.servlet.Servlet
- Overrides:
destroy
in classjakarta.servlet.GenericServlet
-