    001// Licensed under the Apache License, Version 2.0 (the "License");
    002// you may not use this file except in compliance with the License.
    003// You may obtain a copy of the License at
    004//
    005//     http://www.apache.org/licenses/LICENSE-2.0
    006//
    007// Unless required by applicable law or agreed to in writing, software
    008// distributed under the License is distributed on an "AS IS" BASIS,
    009// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    010// See the License for the specific language governing permissions and
    011// limitations under the License.
    012
    013package org.apache.tapestry5;
    014
    015import javax.servlet.ServletContext;
    016
    017import org.apache.tapestry5.modules.TapestryModule;
    018
    019/**
    020 * The TapestryFilter is responsible for intercepting all requests into the web application. It
    021 * identifies the requests
    022 * that are relevant to Tapestry, and lets the servlet container handle the rest. It is also
    023 * responsible for
    024 * initializing Tapestry.
    025 *
    026 * The application is primarily configured via context-level init parameters.
    027 *
    028 * <dl>
    029 * <dt>tapestry.app-package</dt>
    030 * <dd>The application package (used to search for pages, components, etc.)</dd>
    031 * </dl>
    032 *
    033 * In addition, a JVM system property affects configuration: <code>tapestry.execution-mode</code>
    034 * (with default value "production"). This property is a comma-separated list of execution modes.
    035 * For each mode, an additional init parameter is checked for:
    036 * <code>tapestry.<em>mode</em>-modules</code>; this is a comma-separated list of module class names
    037 * to load. In this way, more precise control over the available modules can be obtained which is
    038 * often needed during testing.
    039 */
    040public class TapestryFilter extends org.apache.tapestry5.http.TapestryFilter {
    041
    042    public TapestryFilter() {
    043        super();
    044    }
    045
    046    /**
    047     * Overridden in subclasses to provide additional module classes beyond those normally located. This implementation
    048     * returns an empty array.
    049     *
    050     * @since 5.3
    051     */
    052    protected Class[] provideExtraModuleClasses(ServletContext context)
    053    {
    054        return new Class[] { TapestryModule.class };
    055    }
    056
    057}