|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry5.internal.services.PagePoolImpl
public class PagePoolImpl
Registered as an invalidation listener with the page loader, the component messages source, and the component template source. Any time any of those notice a change, then the entire page pool is wiped.
The master page pool is, itself, divided into individual sub-pools, one for each combination of This code is designed to handle high volume sites and deal with request fluctuations. A soft limit on the number of page instances is enforced. Asking for a page instance when the soft limit has been reached (or exceeded) will result in a delay until a page instance (released from another thread) is available. The delay time is configurable. A hard limit on the number of page instances is enforced. This number may not be exceeded. Requesting a page instance when at the hard limit will result in a runtime exception. As anUpdateListener, the service will reduce the size of each page's pool by
eliminating pages that haven't been used recently.
PagePoolCache| Constructor Summary | |
|---|---|
PagePoolImpl(org.slf4j.Logger logger,
PageLoader pageLoader,
ThreadLocale threadLocale,
int softLimit,
long softWait,
int hardLimit,
long activeWindow)
|
|
| Method Summary | |
|---|---|
void |
checkForUpdates()
On the periodic check for updates call, we clean up the caches, discarding unsued and out of date page instances. |
Page |
checkout(String pageName)
Obtains a page instance from the pool via a logical page name. |
void |
discard(Page page)
Discards a page, which occurs when there are errors invoking lifecycle methods on the page. |
void |
objectWasInvalidated()
Any time templates, classes or messages change, we throw out all instances. |
void |
release(Page page)
Releases a previously checked-out page. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PagePoolImpl(org.slf4j.Logger logger,
PageLoader pageLoader,
ThreadLocale threadLocale,
@Symbol(value="tapestry.page-pool.soft-limit")
int softLimit,
@Symbol(value="tapestry.page-pool.soft-wait")@IntermediateType(value=TimeInterval.class)
long softWait,
@Symbol(value="tapestry.page-pool.hard-limit")
int hardLimit,
@Symbol(value="tapestry.page-pool.active-window")@IntermediateType(value=TimeInterval.class)
long activeWindow)
| Method Detail |
|---|
public Page checkout(String pageName)
PagePool
checkout in interface PagePoolpageName - the canonical page name
public void release(Page page)
PagePool
release in interface PagePoolpage - a previously checked-out pagepublic void discard(Page page)
PagePool
discard in interface PagePoolpage - a previously checked-out pagepublic void objectWasInvalidated()
objectWasInvalidated in interface InvalidationListenerpublic void checkForUpdates()
checkForUpdates in interface UpdateListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||