001 // Copyright 2006, 2009, 2011, 2012 The Apache Software Foundation002 //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 at006 //007 // http://www.apache.org/licenses/LICENSE-2.0008 //009 // Unless required by applicable law or agreed to in writing, software010 // 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 and013 // limitations under the License.014015 package org.apache.tapestry5.runtime;016017 /**018 * A set of methods that allow components to know about page-level operations. When this interface is019 * {@linkplain org.apache.tapestry5.plastic.PlasticClass#introduceInterface(Class)} introduced}, the component will020 * automatically register itself as a listener with the page.021 *022 * @deprecated in 5.3.4, replaced with {@link PageLifecycleCallbackHub}023 */024 public interface PageLifecycleListener025 {026 /**027 * Invoked when the page finishes loading. This occurs once all components are loaded and all parameters have been028 * set.029 *030 * @deprecated in 5.3.4, use {@link org.apache.tapestry5.runtime.PageLifecycleCallbackHub#addPageLoadedCallback(Runnable)} instead031 */032 void containingPageDidLoad();033034 /**035 * Invoked when the page is detached, allowing components a chance to clear out any temporary or client specific036 * 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();041042 /**043 * Invoked when a page is first attached to the current request, giving components a chance to initialize for the044 * 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();049050 /**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.1055 * @deprecated In Tapestry 5.3, with no replacement (persisted fields now lazily restore their state)056 */057 void restoreStateBeforePageAttach();058 }