    001// Copyright 2006, 2008, 2011 The Apache Software Foundation
    002//
    003// Licensed under the Apache License, Version 2.0 (the "License");
    004// you may not use this file except in compliance with the License.
    005// You may obtain a copy of the License at
    006//
    007// http://www.apache.org/licenses/LICENSE-2.0
    008//
    009// Unless required by applicable law or agreed to in writing, software
    010// distributed under the License is distributed on an "AS IS" BASIS,
    011// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    012// See the License for the specific language governing permissions and
    013// limitations under the License.
    014
    015package org.apache.tapestry5.runtime;
    016
    017import org.apache.tapestry5.ComponentResources;
    018
    019/**
    020 * A stateful object that manages the process of rendering a page. Rending a page in Tapestry is based on a command
    021 * queue.
    022 */
    023public interface RenderQueue
    024{
    025    /**
    026     * Adds the new command to the front of the queue.
    027     */
    028    void push(RenderCommand command);
    029
    030    /**
    031     * Indicates that a component is starting its render. A stack of active components is used for exception reporting.
    032     *
    033     * @param resources
    034     *            identifies the component that is rendering
    035     */
    036    void startComponent(ComponentResources resources);
    037
    038    /**
    039     * Corresponds to {@link #startComponent(ComponentResources)}, used to denote when the most recently started
    040     * component finishes
    041     * rendering.
    042     */
    043    void endComponent();
    044}