Class PageRenderQueueImpl
- java.lang.Object
-
- org.apache.tapestry5.internal.services.PageRenderQueueImpl
-
- All Implemented Interfaces:
PageRenderQueue
@Scope("perthread") public class PageRenderQueueImpl extends java.lang.Object implements PageRenderQueue
This services keeps track of the page being rendered and the root command for the partial render, it is therefore request/thread scoped. There's a filter pipeline around the rendering, and that gets to be stateless because this service, at the end of the pipeline, is stateful.
-
-
Constructor Summary
Constructors Constructor Description PageRenderQueueImpl(LoggerSource loggerSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPartialMarkupRendererFilter(PartialMarkupRendererFilter filter)Adds an optional filter to the rendering.voidaddPartialRenderer(RenderCommand renderer)Adds a rendering command to the queue of rendering commands.PagegetRenderingPage()Returns the page that is rendering markup content.voidinitializeForCompletePage(Page page)Initializes the queue for rendering of a complete page.booleanisPartialRenderInitialized()voidrender(MarkupWriter writer)Render to the markup writer, as setup by thePageRenderQueue.initializeForCompletePage(org.apache.tapestry5.internal.structure.Page)orPageRenderQueue.addPartialRenderer(org.apache.tapestry5.runtime.RenderCommand)methods.voidrenderPartial(MarkupWriter writer, JSONObject reply)Performs a partial markup render, as configured viaPageRenderQueue.addPartialRenderer(org.apache.tapestry5.runtime.RenderCommand).voidsetRenderingPage(Page page)Sets the default page that will render the response.
-
-
-
Constructor Detail
-
PageRenderQueueImpl
public PageRenderQueueImpl(LoggerSource loggerSource)
-
-
Method Detail
-
initializeForCompletePage
public void initializeForCompletePage(Page page)
Description copied from interface:PageRenderQueueInitializes the queue for rendering of a complete page.- Specified by:
initializeForCompletePagein interfacePageRenderQueue
-
setRenderingPage
public void setRenderingPage(Page page)
Description copied from interface:PageRenderQueueSets the default page that will render the response.- Specified by:
setRenderingPagein interfacePageRenderQueue
-
isPartialRenderInitialized
public boolean isPartialRenderInitialized()
Description copied from interface:PageRenderQueueReturns true if eitherPageRenderQueue.addPartialRenderer(org.apache.tapestry5.runtime.RenderCommand)orPageRenderQueue.addPartialMarkupRendererFilter(org.apache.tapestry5.services.PartialMarkupRendererFilter)has been invoked.- Specified by:
isPartialRenderInitializedin interfacePageRenderQueue
-
addPartialRenderer
public void addPartialRenderer(RenderCommand renderer)
Description copied from interface:PageRenderQueueAdds a rendering command to the queue of rendering commands. This must not be invoked until after the rendering page has been identified.- Specified by:
addPartialRendererin interfacePageRenderQueue- Parameters:
renderer- responsible for rendering a portion of the final markup
-
getRenderingPage
public Page getRenderingPage()
Description copied from interface:PageRenderQueueReturns the page that is rendering markup content.- Specified by:
getRenderingPagein interfacePageRenderQueue
-
render
public void render(MarkupWriter writer)
Description copied from interface:PageRenderQueueRender to the markup writer, as setup by thePageRenderQueue.initializeForCompletePage(org.apache.tapestry5.internal.structure.Page)orPageRenderQueue.addPartialRenderer(org.apache.tapestry5.runtime.RenderCommand)methods.- Specified by:
renderin interfacePageRenderQueue- Parameters:
writer- to write markup to
-
addPartialMarkupRendererFilter
public void addPartialMarkupRendererFilter(PartialMarkupRendererFilter filter)
Description copied from interface:PageRenderQueueAdds an optional filter to the rendering. Optional filters are temporary, used just during the current partial render (as opposed to filters contributed to thePartialMarkupRendererservice which are permanent, shared and stateless. Filters are added to the end of the pipeline (after all permanent contributions). Filters will be executed in the order in which they are added.- Specified by:
addPartialMarkupRendererFilterin interfacePageRenderQueue- Parameters:
filter- to add to the pipeline
-
renderPartial
public void renderPartial(MarkupWriter writer, JSONObject reply)
Description copied from interface:PageRenderQueuePerforms a partial markup render, as configured viaPageRenderQueue.addPartialRenderer(org.apache.tapestry5.runtime.RenderCommand).- Specified by:
renderPartialin interfacePageRenderQueue- Parameters:
writer- to which markup should be writtenreply- JSONObject which will contain the partial response
-
-