001    // Copyright May 20, 2006 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    package org.apache.tapestry.services;
015    
016    import org.apache.tapestry.IComponent;
017    import org.apache.tapestry.IRequestCycle;
018    import org.apache.tapestry.PageRenderSupport;
019    import org.apache.tapestry.html.Body;
020    
021    
022    /**
023     * Interface that defines the chain of render workers that will be 
024     * invoked after all {@link IComponent} render invocations.
025     * 
026     * @author jkuhnert
027     */
028    public interface ComponentRenderWorker
029    {
030        
031        /**
032         * Invoked just after the components render call, giving services 
033         * implementing the {@link ComponentRenderWorker} interface a guaranteed 
034         * state to work off of.
035         * 
036         * @param cycle
037         *          The associated request for this render.
038         * @param component
039         *          The component that has just been rendered.
040         */
041        void renderComponent(IRequestCycle cycle, IComponent component);
042        
043        /**
044         * Special render for handling html element targets. This is invoked
045         * just after the body component renders its body, but before the script
046         * data is written out. 
047         * 
048         * @param cycle
049         *          The associated request cycle.
050         * @param component
051         *          The {@link Body} component, which holds the needed {@link PageRenderSupport} object.
052         */
053        void renderBody(IRequestCycle cycle, Body component);
054    }