001// Copyright 2006, 2009, 2011, 2012 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
017/**
018 * A set of methods that allow components to know about page-level operations. When this interface is
019 * {@linkplain org.apache.tapestry5.plastic.PlasticClass#introduceInterface(Class)} introduced}, the component will
020 * automatically register itself as a listener with the page.
021 *
022 * @deprecated in 5.3.4, replaced with {@link PageLifecycleCallbackHub}
023 */
024public interface PageLifecycleListener
025{
026    /**
027     * Invoked when the page finishes loading. This occurs once all components are loaded and all parameters have been
028     * set.
029     *
030     * @deprecated in 5.3.4,  use {@link org.apache.tapestry5.runtime.PageLifecycleCallbackHub#addPageLoadedCallback(Runnable)} instead
031     */
032    void containingPageDidLoad();
033
034    /**
035     * Invoked when the page is detached, allowing components a chance to clear out any temporary or client specific
036     * state.
037     *
038     * @deprecated In Tapestry 5.3, with no replacement (detach logic no longer meaningful now that pages are singletons).
039     */
040    void containingPageDidDetach();
041
042    /**
043     * Invoked when a page is first attached to the current request, giving components a chance to initialize for the
044     * current request.
045     *
046     * @deprecated In Tapestry 5.3, with no replacement (attach logic no longer meaningful now that pages are singletons).
047     */
048    void containingPageDidAttach();
049
050    /**
051     * A kind of "pre-attach" phase allowing components to restore internal state before handling the actual attach;
052     * this is primarily used to restore persisted fields.
053     *
054     * @since 5.1.0.1
055     * @deprecated In Tapestry 5.3, with no replacement (persisted fields now lazily restore their state)
056     */
057    void restoreStateBeforePageAttach();
058}