|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.pool.BaseKeyedPoolableObjectFactory
org.apache.tapestry.pageload.PageSource
public class 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)
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.
Constructor Summary | |
---|---|
PageSource()
|
Method Summary | |
---|---|
protected PageKey |
buildKey(IEngine engine,
String pageName)
Builds a key for a named page in the application's current locale. |
protected PageKey |
buildKey(IPage page)
Builds a key from an existing page, using the page's name and locale. |
org.apache.hivemind.ClassResolver |
getClassResolver()
Gets the class resolver used to load all pages / page components. |
IPage |
getPage(IRequestCycle cycle,
String pageName)
Gets the page from a pool, or otherwise loads the page. |
void |
initializeService()
|
Object |
makeObject(Object key)
|
void |
registryDidShutdown()
|
void |
releasePage(IPage page)
Returns the page to the appropriate pool. |
void |
reportStatus(ReportStatusEvent event)
|
void |
resetEventDidOccur()
|
void |
setClassResolver(org.apache.hivemind.ClassResolver resolver)
|
void |
setLoader(IPageLoader loader)
|
void |
setPageSpecificationResolver(PageSpecificationResolver resolver)
|
void |
setPropertySource(IPropertySource propertySource)
|
void |
setRequestCycle(IRequestCycle cycle)
|
void |
setServiceId(String serviceId)
|
Methods inherited from class org.apache.commons.pool.BaseKeyedPoolableObjectFactory |
---|
activateObject, destroyObject, passivateObject, validateObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PageSource()
Method Detail |
---|
public void initializeService()
public void registryDidShutdown()
registryDidShutdown
in interface org.apache.hivemind.events.RegistryShutdownListener
public org.apache.hivemind.ClassResolver getClassResolver()
IPageSource
getClassResolver
in interface IPageSource
ClassResolver
instance used to load classes.protected PageKey buildKey(IEngine engine, String pageName)
engine
- The current engine servicing this request.pageName
- The name of the page to build key for.
Locale
.protected PageKey buildKey(IPage page)
page
- The page to build the key for.
public Object makeObject(Object key) throws Exception
makeObject
in interface org.apache.commons.pool.KeyedPoolableObjectFactory
makeObject
in class org.apache.commons.pool.BaseKeyedPoolableObjectFactory
Exception
public IPage getPage(IRequestCycle cycle, String pageName)
getPage
in interface 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.
PageSpecificationResolver.resolve(IRequestCycle, String)
public void releasePage(IPage page)
IPage.detach()
.
releasePage
in interface IPageSource
page
- The page to release.public void resetEventDidOccur()
resetEventDidOccur
in interface ResetEventListener
public void reportStatus(ReportStatusEvent event)
reportStatus
in interface ReportStatusListener
public void setServiceId(String serviceId)
public void setRequestCycle(IRequestCycle cycle)
public void setClassResolver(org.apache.hivemind.ClassResolver resolver)
public void setPageSpecificationResolver(PageSpecificationResolver resolver)
public void setLoader(IPageLoader loader)
public void setPropertySource(IPropertySource propertySource)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |