Class AnnotationCometDServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.cometd.server.CometDServlet
org.cometd.annotation.server.AnnotationCometDServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class AnnotationCometDServlet extends CometDServlet

A specialized version of CometDServlet that can be configured with the init-parameter services to be a comma separated list of class names of annotated services, that will be processed by ServerAnnotationProcessor upon initialization.

A configuration example:

 <web-app xmlns="http://java.sun.com/xml/ns/javaee" ...>

  <servlet>
    <servlet-name>cometd</servlet-name>
    <servlet-class>org.cometd.annotation.AnnotationCometDServlet</servlet-class>
    <init-param>
      <param-name>services</param-name>
      <param-value>org.cometd.examples.FooService, org.cometd.examples.BarService</param-value>
    </init-param>
  </servlet>
 
See Also:
Serialized Form
  • Constructor Details

    • AnnotationCometDServlet

      public AnnotationCometDServlet()
  • Method Details

    • init

      public void init() throws jakarta.servlet.ServletException
      Overrides:
      init in class CometDServlet
      Throws:
      jakarta.servlet.ServletException
    • newServerAnnotationProcessor

      protected ServerAnnotationProcessor newServerAnnotationProcessor(BayeuxServer bayeuxServer)
    • processService

      protected Object processService(ServerAnnotationProcessor processor, String serviceClassName) throws jakarta.servlet.ServletException
      Throws:
      jakarta.servlet.ServletException
    • newService

      protected Object newService(String serviceClassName) throws Exception
      Throws:
      Exception
    • registerService

      protected void registerService(Object service)
    • destroy

      public void destroy()
      Specified by:
      destroy in interface jakarta.servlet.Servlet
      Overrides:
      destroy in class CometDServlet
    • deregisterService

      protected void deregisterService(Object service)
    • deprocessService

      protected void deprocessService(ServerAnnotationProcessor processor, Object service)
    • getServices

      public List<Object> getServices()