001    // Copyright 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    
015    package org.apache.tapestry5;
016    
017    import java.io.Serializable;
018    
019    /**
020     * An action that is associated with a component. This is used in several areas of Tapestry and is primarily an attempt
021     * to externalize state for a component so that it can be recorded outside the object.
022     * <p/>
023     * ComponentActions should be immutable. They are often created during one request and associated with a particular
024     * component instance. They are then used in a later request (with an equivalent component instance).
025     * <p/>
026     * ComponentActions are serializable (they are often serialized into Base64 strings for storage on the client).
027     */
028    public interface ComponentAction<T> extends Serializable
029    {
030        /**
031         * Passed a component instance, the action should operate upon the instance.
032         */
033        void execute(T component);
034    }