Package org.cometd.annotation
Class AnnotationCometDServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.cometd.server.CometDServlet
org.cometd.annotation.AnnotationCometDServlet
- All Implemented Interfaces:
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 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
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AnnotationCometDServlet()
-
Method Summary
Modifier and Type Method Description protected void
deprocessService(ServerAnnotationProcessor processor, Object service)
protected void
deregisterService(Object service)
void
destroy()
protected List<Object>
getServices()
void
init()
protected ServerAnnotationProcessor
newServerAnnotationProcessor(BayeuxServer bayeuxServer)
protected Object
newService(String serviceClassName)
protected Object
processService(ServerAnnotationProcessor processor, String serviceClassName)
protected void
registerService(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
-
Constructor Details
-
AnnotationCometDServlet
public AnnotationCometDServlet()
-
-
Method Details
-
init
public void init() throws javax.servlet.ServletException- Overrides:
init
in classCometDServlet
- Throws:
javax.servlet.ServletException
-
newServerAnnotationProcessor
-
processService
protected Object processService(ServerAnnotationProcessor processor, String serviceClassName) throws javax.servlet.ServletException- Throws:
javax.servlet.ServletException
-
newService
- Throws:
Exception
-
registerService
-
destroy
public void destroy()- Specified by:
destroy
in interfacejavax.servlet.Servlet
- Overrides:
destroy
in classCometDServlet
- See Also:
GenericServlet.destroy()
-
deregisterService
-
deprocessService
-
getServices
-