|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.primix.tapestry.AbstractComponent | +--com.primix.tapestry.BaseComponent | +--com.primix.tapestry.AbstractPage
Abstract base class implementing the IPage
interface.
Field Summary | |
protected IEngine |
engine
The IEngine the page is currently attached to. |
protected java.lang.String |
name
The name of this page. |
Fields inherited from class com.primix.tapestry.BaseComponent |
outer, OUTER_INIT_SIZE, outerCount |
Fields inherited from class com.primix.tapestry.AbstractComponent |
id, page, specification, wrapped, wrappedCount |
Constructor Summary | |
AbstractPage()
|
Method Summary | |
void |
addPageCleanupListener(PageCleanupListener listener)
|
void |
addPageDetachListener(PageDetachListener listener)
|
void |
addPageRenderListener(PageRenderListener listener)
|
void |
attach(IEngine value)
Called by the engine to attach the page
to itself. |
void |
beginResponse(IResponseWriter writer,
IRequestCycle cycle)
Does nothing, subclasses may override as needed. |
void |
cleanupPage()
Invokes PageCleanupListener.pageCleanup(PageEvent) on any
listener. |
void |
detach()
Prepares the page to be returned to the pool. |
protected void |
firePageBeginRender()
|
protected void |
firePageCleanup()
|
protected void |
firePageDetached()
|
protected void |
firePageEndRender()
|
ChangeObserver |
getChangeObserver()
Returns the object (effectively, an IPageRecorder ) that is notified
of any changes to persistant properties of the page. |
IEngine |
getEngine()
Returns the IEngine that the page is currently
attached to. |
java.lang.String |
getExtendedId()
Returns the name of the page. |
java.lang.String |
getIdPath()
Pages always return null for idPath. |
java.util.Locale |
getLocale()
Returns the locale for the page, which may be null if the locale is not known (null corresponds to the "default locale"). |
java.lang.String |
getName()
The logical name is the name given by the application. |
IComponent |
getNestedComponent(java.lang.String path)
Returns a particular component from within the page. |
IPage |
getPage()
Returns the page which ultimately contains the receiver. |
IRequestCycle |
getRequestCycle()
Returns the current IRequestCycle . |
abstract IResponseWriter |
getResponseWriter(java.io.OutputStream out)
Implemented in subclasses to provide a particular kind of response writer (and therefore, a particular kind of content). |
java.lang.Object |
getVisit()
Returns the visit object obtained from the engine via IEngine.getVisit(IRequestCycle) . |
void |
renderPage(IResponseWriter writer,
IRequestCycle cycle)
Invokes PageRenderListener.pageBeginRender(PageEvent)
Invokes beginResponse(IResponseWriter, IRequestCycle)
Invokes IRequestCycle.commitPageChanges() (if not rewinding)
Invokes BaseComponent.render(IResponseWriter, IRequestCycle)
Invokes PageRenderListener.pageEndRender(PageEvent) (this occurs
even if a previous step throws an exception) |
void |
setChangeObserver(ChangeObserver value)
|
void |
setLocale(java.util.Locale value)
Updates the page's locale. |
void |
setName(java.lang.String value)
|
void |
setRequestCycle(IRequestCycle value)
Invoked by the IRequestCycle to inform the page of the cycle,
as it is loaded. |
void |
validate(IRequestCycle cycle)
By default, pages are not protected and this method does nothing. |
Methods inherited from class com.primix.tapestry.BaseComponent |
addOuter, finishLoad, readTemplate, render |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.primix.tapestry.IComponent |
addAsset, addComponent, addWrapped, finishLoad, getAsset, getAssets, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainer, getId, getSpecification, renderWrapped, setBinding, setContainer, setId, setPage, setSpecification |
Methods inherited from interface com.primix.tapestry.IRender |
render |
Field Detail |
protected IEngine engine
IEngine
the page is currently attached to. This may
be read, but not changed, but subclasses.protected java.lang.String name
Constructor Detail |
public AbstractPage()
Method Detail |
public abstract IResponseWriter getResponseWriter(java.io.OutputStream out)
getResponseWriter
in interface IPage
public void detach()
PageDetachListener.pageDetached(PageEvent)
on all listeners
Subclasses may override this method, but must invoke this implementation (usually, last).
detach
in interface IPage
com.primix.tapestry.IPage
IPageSource.releasePage(IPage)
public IEngine getEngine()
IPage
IEngine
that the page is currently
attached to.getEngine
in interface IPage
public ChangeObserver getChangeObserver()
IPage
IPageRecorder
) that is notified
of any changes to persistant properties of the page.getChangeObserver
in interface IPage
getChangeObserver
in class AbstractComponent
com.primix.tapestry.AbstractComponent
IPage.getChangeObserver()
public java.lang.String getExtendedId()
getExtendedId
in interface IComponent
getExtendedId
in class AbstractComponent
com.primix.tapestry.IComponent
IComponent.getIdPath()
public java.lang.String getIdPath()
getIdPath
in interface IComponent
getIdPath
in class AbstractComponent
com.primix.tapestry.IComponent
IComponent.getId()
public java.util.Locale getLocale()
getLocale
in interface IPage
public void setLocale(java.util.Locale value)
IPage
ApplicationRuntimeException
.setLocale
in interface IPage
public java.lang.String getName()
IPage
getName
in interface IPage
public IPage getPage()
IComponent
getPage
in interface IComponent
getPage
in class AbstractComponent
public IComponent getNestedComponent(java.lang.String path)
IPage
getNestedComponent
in interface IPage
com.primix.tapestry.IPage
NoSuchComponentException
- runtime exception
thrown if the path does not identify a component.public void attach(IEngine value)
engine
to attach the page
to itself. Does
not change the locale, but since a page is selected
from the IPageSource
pool based on its
locale matching the engine's locale, they should match
anyway.attach
in interface IPage
public void renderPage(IResponseWriter writer, IRequestCycle cycle) throws RequestCycleException
PageRenderListener.pageBeginRender(PageEvent)
beginResponse(IResponseWriter, IRequestCycle)
IRequestCycle.commitPageChanges()
(if not rewinding)
BaseComponent.render(IResponseWriter, IRequestCycle)
PageRenderListener.pageEndRender(PageEvent)
(this occurs
even if a previous step throws an exception)renderPage
in interface IPage
public void setChangeObserver(ChangeObserver value)
setChangeObserver
in interface IPage
public void setName(java.lang.String value)
setName
in interface IPage
public void validate(IRequestCycle cycle) throws RequestCycleException
validate
in interface IPage
public void beginResponse(IResponseWriter writer, IRequestCycle cycle) throws RequestCycleException
beginResponse
in interface IPage
public IRequestCycle getRequestCycle()
IPage
IRequestCycle
. This is set when the
page is loaded (or obtained from the pool) and attached to the
engine
.getRequestCycle
in interface IPage
public void setRequestCycle(IRequestCycle value)
IPage
IRequestCycle
to inform the page of the cycle,
as it is loaded.setRequestCycle
in interface IPage
public void cleanupPage()
PageCleanupListener.pageCleanup(PageEvent)
on any
listener.
Subclasses may override, but should invoke this implementation.
cleanupPage
in interface IPage
public java.lang.Object getVisit()
IEngine.getVisit(IRequestCycle)
.getVisit
in interface IPage
public void addPageDetachListener(PageDetachListener listener)
addPageDetachListener
in interface IPage
public void addPageRenderListener(PageRenderListener listener)
addPageRenderListener
in interface IPage
public void addPageCleanupListener(PageCleanupListener listener)
addPageCleanupListener
in interface IPage
protected void firePageDetached()
protected void firePageBeginRender()
protected void firePageEndRender()
protected void firePageCleanup()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |