]> WPIA git - gigi.git/blob - lib/servlet-api/javax/servlet/ServletContainerInitializer.java
adding servlet api (from tomcat)
[gigi.git] / lib / servlet-api / javax / servlet / ServletContainerInitializer.java
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 package javax.servlet;
18
19 import java.util.Set;
20
21 /**
22  * ServletContainerInitializers (SCIs) are registered via an entry in the
23  * file META-INF/services/javax.servlet.ServletContainerInitializer that must be
24  * included in the JAR file that contains the SCI implementation.
25  * <p>
26  * SCI processing is performed regardless of the setting of metadata-complete.
27  * SCI processing can be controlled per JAR file via fragment ordering. If an
28  * absolute ordering is defined, the only those JARs included in the ordering
29  * will be processed for SCIs. To disable SCI processing completely, an empty
30  * absolute ordering may be defined.
31  * <p>
32  * SCIs register an interest in annotations (class, method or field) and/or
33  * types via the {@link javax.servlet.annotation.HandlesTypes} annotation which
34  * is added to the class.
35  *
36  * @since Servlet 3.0
37  */
38 public interface ServletContainerInitializer {
39
40     /**
41      * Receives notification during startup of a web application of the classes
42      * within the web application that matched the criteria defined via the
43      * {@link javax.servlet.annotation.HandlesTypes} annotation.
44      *
45      * @param c     The (possibly null) set of classes that met the specified
46      *              criteria
47      * @param ctx   The ServletContext of the web application in which the
48      *              classes were discovered
49      *
50      * @throws ServletException If an error occurs
51      */
52     void onStartup(Set<Class<?>> c, ServletContext ctx) throws ServletException;
53 }