|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tapestry.pageload.PageSource
A source for pages for a particular application. Each application
should have its own PageSource
, storing it into the
ServletContext
using a unique key (usually built from
the application name).
The PageSource
acts as a pool for IPage
instances.
Pages are retrieved from the pool using getPage(IRequestCycle, String, IMonitor)
and are later returned to the pool using releasePage(IPage)
.
TBD: Pooled pages stay forever. Need a strategy for cleaning up the pool, tracking which pages have been in the pool the longest, etc. A mechanism for reporting pool statistics would be useful.
Constructor Summary | |
PageSource(IEngine engine)
|
Method Summary | |
protected MultiKey |
buildKey(IEngine engine,
String pageName)
Builds a key for a named page in the application's current locale. |
protected MultiKey |
buildKey(IPage page)
Builds a key from an existing page, using the page's name and locale. |
protected void |
discardPageLoader(PageLoader loader)
Invoked once the PageLoader is not
longer needed; it is then returned to the pool. |
protected void |
discardPageSpecificationResolver(PageSpecificationResolver resolver)
Invoked once the PageSpecificationResolver is no longer
needed, it is returned to the pool. |
IPage |
getPage(IRequestCycle cycle,
String pageName,
IMonitor monitor)
Gets the page from a pool, or otherwise loads the page. |
protected PageLoader |
getPageLoader(IRequestCycle cycle)
Invoked to obtain an instance of PageLoader . |
protected PageSpecificationResolver |
getPageSpecificationResolver(IRequestCycle cycle)
Invoked to obtain an instance of PageSpecificationResolver . |
IResourceResolver |
getResourceResolver()
|
void |
releasePage(IPage page)
Returns the page to the appropriate pool. |
void |
reset()
Invoked (during testing primarily) to release the entire pool of pages, and the caches of bindings and assets. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PageSource(IEngine engine)
Method Detail |
public IResourceResolver getResourceResolver()
getResourceResolver
in interface IPageSource
protected MultiKey buildKey(IEngine engine, String pageName)
protected MultiKey buildKey(IPage page)
public IPage getPage(IRequestCycle cycle, String pageName, IMonitor monitor)
getPage
in interface IPageSource
org.apache.tapestry.engine.IPageSource
cycle
- the current request cyclepageName
- the name of the page. May be qualified with a library id prefix, which
may even be nested. Unqualified names are searched for extensively in the application
namespace, and then in the framework namespace.monitor
- informed of any page loading activityprotected PageLoader getPageLoader(IRequestCycle cycle)
PageLoader
. An instance if aquired from the pool or,
if none are available, created fresh.protected void discardPageLoader(PageLoader loader)
PageLoader
is not
longer needed; it is then returned to the pool.protected PageSpecificationResolver getPageSpecificationResolver(IRequestCycle cycle)
PageSpecificationResolver
.
An instance is acquired form the pool or, if none are available,
a new one is instantiated.protected void discardPageSpecificationResolver(PageSpecificationResolver resolver)
PageSpecificationResolver
is no longer
needed, it is returned to the pool.public void releasePage(IPage page)
IPage.detach()
.releasePage
in interface IPageSource
public void reset()
reset
in interface IPageSource
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |