    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.services.pageload;
    014
    015import org.apache.tapestry5.ioc.annotations.UsesConfiguration;
    016
    017/**
    018 * Used to perform a pre-load of pages, at startup time. This helps ensure that the first actual
    019 * request is processed promptly.
    020 *
    021 * The configuration is simply the logical names of pages to load initially.
    022 *
    023 * Pages are loaded in the default locale (the first locale listed in
    024 * {@link org.apache.tapestry5.SymbolConstants#SUPPORTED_LOCALES}). This ensures that the majority
    025 * of class loading and transformation, template parsing, and so forth occurs immediately (loading
    026 * an existing page in a different locale is a relatively inexpensive operation compared to the
    027 * first load of the page).
    028 *
    029 * @since 5.4
    030 */
    031@UsesConfiguration(String.class)
    032public interface PagePreloader
    033{
    034    /**
    035     * Loads any pages, subject to the {@linkplain org.apache.tapestry5.SymbolConstants#PRELOADER_MODE preloader mode}.
    036     */
    037    void preloadPages();
    038}