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.internal.services;
014
015import org.apache.tapestry5.ComponentResources;
016import org.apache.tapestry5.EventContext;
017
018import java.io.IOException;
019
020/**
021 * Responsible for handling the response for a page called with an unknown activation context when the check itself is
022 * enabled.
023 * The default implementation is to respond with a 404 NOT FOUND.
024 *
025 * @see <a href="http://issues.apache.org/jira/browse/TAP5-2070">TAP5-2070</a>
026 * @see org.apache.tapestry5.annotations.UnknownActivationContextCheck
027 * @see org.apache.tapestry5.services.HttpError
028 *
029 * @since 5.4
030 */
031public interface UnknownActivationContextHandler
032{
033    /**
034     * Answer the client in the case of a request coming in with an unknown activation context.
035     */
036    @SuppressWarnings("unchecked")
037    void handleUnknownContext(ComponentResources pageResources, EventContext activationContext)
038                            throws IOException;
039}