Class PageImpl
- java.lang.Object
- 
- org.apache.tapestry5.internal.structure.PageImpl
 
- 
- All Implemented Interfaces:
- Page,- PageLifecycleCallbackHub
 
 public class PageImpl extends java.lang.Object implements Page 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.tapestry5.internal.structure.PagePage.Stats
 
- 
 - 
Constructor SummaryConstructors Constructor Description PageImpl(java.lang.String name, ComponentResourceSelector selector, PersistentFieldManager persistentFieldManager, PerthreadManager perThreadManager, MetaDataLocator metaDataLocator)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLifecycleListener(PageLifecycleListener listener)Adds a listener that is notified of large scale page events.voidaddPageAttachedCallback(java.lang.Runnable callback)Adds a callback for when the page is attached to the request.voidaddPageDetachedCallback(java.lang.Runnable callback)Adds a callback for when the page is detached from the request.voidaddPageLoadedCallback(java.lang.Runnable callback)Adds a callback for when the page is first loaded.voidaddResetCallback(java.lang.Runnable callback)A reset occurs when a request for a page arrives that did not originate on the same page.voidaddResetListener(PageResetListener listener)Adds a new listener for page reset events.voidaddVerifyCallback(java.lang.Runnable callback)Adds a verify callback, which is allowed while the page is loading.voidattached()Invoked to inform the page that it is attached to the current request.booleandetached()Invoked to inform the page that it is being detached from the current request.voiddiscardPersistentFieldChanges()Discards all persistent field changes for the page containing the component.intgetAttachCount()Returns the number of times the page has been attached to a request.ComponentPageElementgetComponentElementByNestedId(java.lang.String nestedId)Retrieves a component element by its nested id (a sequence of simple ids, separated by dots).java.lang.ObjectgetFieldChange(java.lang.String nestedId, java.lang.String fieldName)Gets a change for a field within the component.org.slf4j.LoggergetLogger()Returns the logger of the root component element.java.lang.StringgetName()Returns the short, logical name for the page.ComponentgetRootComponent()The root component of the page.ComponentPageElementgetRootElement()The root component of the page.ComponentResourceSelectorgetSelector()The selector (which includes Locale) used when the page was constructor.Page.StatsgetStats()Returns the page construction statistics for this page.booleanhasResetListeners()Returns true if there are anyPageResetListenerlisteners.booleanisExactParameterCountMatch()Returns true if extract parameter count matching is enabled.voidloaded()Inform the page that it is now completely loaded.voidpageReset()Invoked to notifyPageResetListenerlisteners.voidpersistFieldChange(ComponentResources resources, java.lang.String fieldName, java.lang.Object newValue)Posts a change to a persistent field.voidremoveLifecycleListener(PageLifecycleListener listener)Removes a listener that was previously added.voidsetRootElement(ComponentPageElement component)Invoked during page construction time to connect the page's root component to the page instance.voidsetStats(Page.Stats stats)Invoked once at the end of page construction, to provide page construction statistics.java.lang.StringtoString()
 
- 
- 
- 
Constructor Detail- 
PageImplpublic PageImpl(java.lang.String name, ComponentResourceSelector selector, PersistentFieldManager persistentFieldManager, PerthreadManager perThreadManager, MetaDataLocator metaDataLocator) - Parameters:
- name- canonicalized page name
- selector- used to locate resources
- persistentFieldManager- for access to cross-request persistent values
- perThreadManager-
- metaDataLocator-
 
 
- 
 - 
Method Detail- 
setStatspublic void setStats(Page.Stats stats) Description copied from interface:PageInvoked once at the end of page construction, to provide page construction statistics.
 - 
getStatspublic Page.Stats getStats() Description copied from interface:PageReturns the page construction statistics for this page.
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
getComponentElementByNestedIdpublic ComponentPageElement getComponentElementByNestedId(java.lang.String nestedId) Description copied from interface:PageRetrieves a component element by its nested id (a sequence of simple ids, separated by dots). The individual names in the nested id are matched without regards to case. A nested id of '' (the empty string) returns the root element of the page.- Specified by:
- getComponentElementByNestedIdin interface- Page
 
 - 
getSelectorpublic ComponentResourceSelector getSelector() Description copied from interface:PageThe selector (which includes Locale) used when the page was constructor.- Specified by:
- getSelectorin interface- Page
 
 - 
setRootElementpublic void setRootElement(ComponentPageElement component) Description copied from interface:PageInvoked during page construction time to connect the page's root component to the page instance.- Specified by:
- setRootElementin interface- Page
 
 - 
getRootElementpublic ComponentPageElement getRootElement() Description copied from interface:PageThe root component of the page. This is the wrapper around the end developer's view of the page.- Specified by:
- getRootElementin interface- Page
 
 - 
getRootComponentpublic Component getRootComponent() Description copied from interface:PageThe root component of the page. A convenience over invoking getRootElement().getComponent().- Specified by:
- getRootComponentin interface- Page
 
 - 
addLifecycleListenerpublic void addLifecycleListener(PageLifecycleListener listener) Description copied from interface:PageAdds a listener that is notified of large scale page events.- Specified by:
- addLifecycleListenerin interface- Page
 
 - 
removeLifecycleListenerpublic void removeLifecycleListener(PageLifecycleListener listener) Description copied from interface:PageRemoves a listener that was previously added.- Specified by:
- removeLifecycleListenerin interface- Page
 
 - 
detachedpublic boolean detached() Description copied from interface:PageInvoked to inform the page that it is being detached from the current request. This occurs just before the page is returned to the page pool. A page may be clean or dirty. A page is dirty if its dirty count is greater than zero (meaning that, during the render of the page, some components did not fully render), or if any of its listeners throw an exception from containingPageDidDetach(). The page pool should discard pages that are dirty, rather than store them into the pool. Under Tapestry 5.2 and pool-less pages, the result is ignored; all mutable state is expected to be discarded automatically from thePerthreadManager. A future release of Tapestry will likely convert this method to type void.- Specified by:
- detachedin interface- Page
- Returns:
- true if the page is "dirty", false otherwise
- See Also:
- PageLifecycleListener.containingPageDidDetach()
 
 - 
loadedpublic void loaded() Description copied from interface:PageInform the page that it is now completely loaded.- Specified by:
- loadedin interface- Page
- See Also:
- PageLifecycleListener.containingPageDidLoad()
 
 - 
attachedpublic void attached() Description copied from interface:PageInvoked to inform the page that it is attached to the current request. This occurs when a page is first referenced within a request. If the page was created from scratch for this request, the call toPage.loaded()will preceded the call toPage.attached(). First all listeners havePageLifecycleListener.restoreStateBeforePageAttach()invoked, followed byPageLifecycleListener.containingPageDidAttach().
 - 
getLoggerpublic org.slf4j.Logger getLogger() Description copied from interface:PageReturns the logger of the root component element. Any logging about page construction or activity should be sent to this logger.
 - 
persistFieldChangepublic void persistFieldChange(ComponentResources resources, java.lang.String fieldName, java.lang.Object newValue) Description copied from interface:PagePosts a change to a persistent field.- Specified by:
- persistFieldChangein interface- Page
- Parameters:
- resources- the component resources for the component or mixin containing the field whose value changed
- fieldName- the name of the field
- newValue- the new value for the field
 
 - 
getFieldChangepublic java.lang.Object getFieldChange(java.lang.String nestedId, java.lang.String fieldName) Description copied from interface:PageGets a change for a field within the component.- Specified by:
- getFieldChangein interface- Page
- Parameters:
- nestedId- the nested component id of the component containing the field
- fieldName- the name of the persistent field
- Returns:
- the value, or null if no value is stored
 
 - 
discardPersistentFieldChangespublic void discardPersistentFieldChanges() Description copied from interface:PageDiscards all persistent field changes for the page containing the component. Changes are eliminated from persistent storage (such as theSession) which will take effect in the next request (the attached page instance is not affected).- Specified by:
- discardPersistentFieldChangesin interface- Page
 
 - 
getNamepublic java.lang.String getName() Description copied from interface:PageReturns the short, logical name for the page. This is the page name as it might included in an action or page render URL (though it will be converted to lower case when it is included).
 - 
addResetCallbackpublic void addResetCallback(java.lang.Runnable callback) Description copied from interface:PageLifecycleCallbackHubA reset occurs when a request for a page arrives that did not originate on the same page. This gives the application a chance to reset the state of the page.- Specified by:
- addResetCallbackin interface- PageLifecycleCallbackHub
- Parameters:
- callback- invoked when a page is activated by link from some other page.
 
 - 
addResetListenerpublic void addResetListener(PageResetListener listener) Description copied from interface:PageAdds a new listener for page reset events.- Specified by:
- addResetListenerin interface- Page
- Parameters:
- listener- will receive notifications when the page is accessed from a different page
 
 - 
addVerifyCallbackpublic void addVerifyCallback(java.lang.Runnable callback) Description copied from interface:PageLifecycleCallbackHubAdds a verify callback, which is allowed while the page is loading. Such callbacks are invoked once, after the page has been loaded successfully, and are then discarded. This was added specifically to ensure that components only verify that required parameters are bound after all components and mixins of the page have had a chance to initialize.- Specified by:
- addVerifyCallbackin interface- PageLifecycleCallbackHub
- Parameters:
- callback- to be invoked after page loaded
 
 - 
pageResetpublic void pageReset() Description copied from interface:PageInvoked to notifyPageResetListenerlisteners.
 - 
hasResetListenerspublic boolean hasResetListeners() Description copied from interface:PageReturns true if there are anyPageResetListenerlisteners.- Specified by:
- hasResetListenersin interface- Page
 
 - 
getAttachCountpublic int getAttachCount() Description copied from interface:PageReturns the number of times the page has been attached to a request. This is a rough measure of how important the page is, relative to other pages. This value is volatile, changing constantly.- Specified by:
- getAttachCountin interface- Page
 
 - 
isExactParameterCountMatchpublic boolean isExactParameterCountMatch() Description copied from interface:PageReturns true if extract parameter count matching is enabled.- Specified by:
- isExactParameterCountMatchin interface- Page
- See Also:
- MetaDataConstants.UNKNOWN_ACTIVATION_CONTEXT_CHECK
 
 - 
addPageLoadedCallbackpublic void addPageLoadedCallback(java.lang.Runnable callback) Description copied from interface:PageLifecycleCallbackHubAdds a callback for when the page is first loaded. Callbacks are invoked in the order they are added to the page. They are invoked once and then discarded.- Specified by:
- addPageLoadedCallbackin interface- PageLifecycleCallbackHub
- Parameters:
- callback- invoked once, when page is first loaded
 
 - 
addPageAttachedCallbackpublic void addPageAttachedCallback(java.lang.Runnable callback) Description copied from interface:PageLifecycleCallbackHubAdds a callback for when the page is attached to the request.- Specified by:
- addPageAttachedCallbackin interface- PageLifecycleCallbackHub
 
 - 
addPageDetachedCallbackpublic void addPageDetachedCallback(java.lang.Runnable callback) Description copied from interface:PageLifecycleCallbackHubAdds a callback for when the page is detached from the request.- Specified by:
- addPageDetachedCallbackin interface- PageLifecycleCallbackHub
 
 
- 
 
-