org.cometd.annotation.AnnotationCometDServlet Maven / Gradle / Ivy
/*
* Copyright (c) 2008-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.cometd.annotation;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import org.cometd.bayeux.server.BayeuxServer;
import org.cometd.server.CometDServlet;
import org.eclipse.jetty.util.Loader;
/**
* A specialized version of {@link 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 {@link 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>
*
*/
public class AnnotationCometDServlet extends CometDServlet {
private final List