001// Copyright 2006, 2007, 2008 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.services;
016
017import org.apache.tapestry5.ioc.annotations.UsesOrderedConfiguration;
018
019import java.io.IOException;
020
021/**
022 * Handler interface for component event requests. Component event requests <em>do things</em> such as process a form
023 * submission or otherwise change state. In the majority of cases, after the component event, a redirect response is
024 * sent to the client which, in turn, causes a page render.
025 * <p/>
026 * The ComponentEventRequestHandler service is a pipeline, allowing extensibility via contributed {@linkplain
027 * org.apache.tapestry5.services.ComponentEventRequestFilter filters}.    It may be distinguished by the @{@link
028 * org.apache.tapestry5.services.Traditional} marker annotation.
029 * <p/>
030 * A second service, AjaxComponentEventRequestHandler is also a pipeline and may be distinguished by the @{@link
031 * org.apache.tapestry5.services.Ajax} marker annotation.
032 *
033 * @see org.apache.tapestry5.corelib.components.ActionLink
034 * @see org.apache.tapestry5.corelib.components.Form
035 */
036@UsesOrderedConfiguration(ComponentEventRequestFilter.class)
037public interface ComponentEventRequestHandler
038{
039    /**
040     * Handler for a component action request which will trigger an event on a component and use the return value to
041     * send a response to the client (typically, a redirect to a page render URL).
042     *
043     * @param parameters defining the requst
044     */
045    void handle(ComponentEventRequestParameters parameters) throws IOException;
046}