org.apache.tapestry5.internal.services
Class PageSourceImpl

java.lang.Object
  extended by org.apache.tapestry5.internal.services.PageSourceImpl
All Implemented Interfaces:
PageSource, InvalidationListener

public class PageSourceImpl
extends Object
implements PageSource, InvalidationListener


Constructor Summary
PageSourceImpl(PageLoader pageLoader, ComponentRequestSelectorAnalyzer selectorAnalyzer)
           
 
Method Summary
 void clearCache()
          Clears the source's cache of loaded pages.
 Set<Page> getAllPages()
          Returns all currently loaded pages.
 Page getPage(String canonicalPageName)
          Returns a loaded instance of the indicated page, using the Locale and other information from the ComponentResourceSelector obtained from the ComponentRequestSelectorAnalyzer.
 void objectWasInvalidated()
          Invoked to indicate that some object is invalid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageSourceImpl

public PageSourceImpl(PageLoader pageLoader,
                      ComponentRequestSelectorAnalyzer selectorAnalyzer)
Method Detail

objectWasInvalidated

public void objectWasInvalidated()
Description copied from interface: InvalidationListener
Invoked to indicate that some object is invalid. The receiver should clear its cache.

Specified by:
objectWasInvalidated in interface InvalidationListener

getPage

public Page getPage(String canonicalPageName)
Description copied from interface: PageSource
Returns a loaded instance of the indicated page, using the Locale and other information from the ComponentResourceSelector obtained from the ComponentRequestSelectorAnalyzer.

Specified by:
getPage in interface PageSource
Returns:
existing, or newly created, page instance

clearCache

public void clearCache()
Description copied from interface: PageSource
Clears the source's cache of loaded pages. This occurs when an outside change to the world invalidates created page instances. Introduced to handle the case where a page has a DynamicTemplate, but the underlying Resource is noticed to have changed.

Specified by:
clearCache in interface PageSource

getAllPages

public Set<Page> getAllPages()
Description copied from interface: PageSource
Returns all currently loaded pages. This will include any previously loaded pages not yet reclaimed by the garbage collector, and may include the same page loaded for different ComponentResourceSelectors. This is needed for reporting purposes only.

Specified by:
getAllPages in interface PageSource
See Also:
PageCatalog


Copyright © 2003-2012 The Apache Software Foundation.