Package org.cometd.annotation.server
Class AnnotationCometDServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.cometd.server.CometDServlet
-
- org.cometd.annotation.server.AnnotationCometDServlet
-
- All Implemented Interfaces:
java.io.Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
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 byServerAnnotationProcessor
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 Summary
Constructors Constructor Description AnnotationCometDServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
deprocessService(ServerAnnotationProcessor processor, java.lang.Object service)
protected void
deregisterService(java.lang.Object service)
void
destroy()
java.util.List<java.lang.Object>
getServices()
void
init()
protected ServerAnnotationProcessor
newServerAnnotationProcessor(BayeuxServer bayeuxServer)
protected java.lang.Object
newService(java.lang.String serviceClassName)
protected java.lang.Object
processService(ServerAnnotationProcessor processor, java.lang.String serviceClassName)
protected void
registerService(java.lang.Object service)
-
Methods inherited from class org.cometd.server.CometDServlet
getBayeux, newBayeuxServer, service, serviceOptions
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
-
-
-
-
Method Detail
-
init
public void init() throws javax.servlet.ServletException
- Overrides:
init
in classCometDServlet
- Throws:
javax.servlet.ServletException
-
newServerAnnotationProcessor
protected ServerAnnotationProcessor newServerAnnotationProcessor(BayeuxServer bayeuxServer)
-
processService
protected java.lang.Object processService(ServerAnnotationProcessor processor, java.lang.String serviceClassName) throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
-
newService
protected java.lang.Object newService(java.lang.String serviceClassName) throws java.lang.Exception
- Throws:
java.lang.Exception
-
registerService
protected void registerService(java.lang.Object service)
-
destroy
public void destroy()
- Specified by:
destroy
in interfacejavax.servlet.Servlet
- Overrides:
destroy
in classCometDServlet
-
deregisterService
protected void deregisterService(java.lang.Object service)
-
deprocessService
protected void deprocessService(ServerAnnotationProcessor processor, java.lang.Object service)
-
getServices
public java.util.List<java.lang.Object> getServices()
-
-