org.apache.tapestry5.internal.services
Class PageRenderQueueImpl

java.lang.Object
  extended by org.apache.tapestry5.internal.services.PageRenderQueueImpl
All Implemented Interfaces:
PageRenderQueue

@Scope(value="perthread")
public class PageRenderQueueImpl
extends 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
PageRenderQueueImpl(LoggerSource loggerSource)
           
 
Method Summary
 void addPartialMarkupRendererFilter(PartialMarkupRendererFilter filter)
          Adds an optional filter to the rendering.
 Page getRenderingPage()
          Returns the page that is rendering markup content.
 RenderCommand getRootRenderCommand()
          Obtains the value previously supplied to PageRenderQueue.initializeForPartialPageRender(org.apache.tapestry5.runtime.RenderCommand).
 void initializeForCompletePage(Page page)
          Initializes the queue for rendering of a complete page.
 void initializeForPartialPageRender(RenderCommand rootCommand)
          Initializes the queue for rendering of a portion of a page.
 boolean isPartialRenderInitialized()
          Returns true if PageRenderQueue.initializeForPartialPageRender(org.apache.tapestry5.runtime.RenderCommand) has been invoked.
 void render(MarkupWriter writer)
          Render to the write, as setup by the initialize method.
 void renderPartial(MarkupWriter writer, JSONObject reply)
          Performs a partial markup render, as configured via PageRenderQueue.initializeForPartialPageRender(org.apache.tapestry5.runtime.RenderCommand).
 void setRenderingPage(Page page)
          Sets the default page that will render the response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageRenderQueueImpl

public PageRenderQueueImpl(LoggerSource loggerSource)
Method Detail

initializeForCompletePage

public void initializeForCompletePage(Page page)
Description copied from interface: PageRenderQueue
Initializes the queue for rendering of a complete page.

Specified by:
initializeForCompletePage in interface PageRenderQueue

setRenderingPage

public void setRenderingPage(Page page)
Description copied from interface: PageRenderQueue
Sets the default page that will render the response.

Specified by:
setRenderingPage in interface PageRenderQueue

isPartialRenderInitialized

public boolean isPartialRenderInitialized()
Description copied from interface: PageRenderQueue
Returns true if PageRenderQueue.initializeForPartialPageRender(org.apache.tapestry5.runtime.RenderCommand) has been invoked.

Specified by:
isPartialRenderInitialized in interface PageRenderQueue

initializeForPartialPageRender

public void initializeForPartialPageRender(RenderCommand rootCommand)
Description copied from interface: PageRenderQueue
Initializes the queue for rendering of a portion of a page.

Specified by:
initializeForPartialPageRender in interface PageRenderQueue

getRootRenderCommand

public RenderCommand getRootRenderCommand()
Description copied from interface: PageRenderQueue
Obtains the value previously supplied to PageRenderQueue.initializeForPartialPageRender(org.apache.tapestry5.runtime.RenderCommand). This allows the "natural" renderer to be substituted or otherwise manipulated.

Specified by:
getRootRenderCommand in interface PageRenderQueue
Returns:
the root renderer

getRenderingPage

public Page getRenderingPage()
Description copied from interface: PageRenderQueue
Returns the page that is rendering markup content.

Specified by:
getRenderingPage in interface PageRenderQueue

render

public void render(MarkupWriter writer)
Description copied from interface: PageRenderQueue
Render to the write, as setup by the initialize method.

Specified by:
render in interface PageRenderQueue
Parameters:
writer - to write markup to

addPartialMarkupRendererFilter

public void addPartialMarkupRendererFilter(PartialMarkupRendererFilter filter)
Description copied from interface: PageRenderQueue
Adds an optional filter to the rendering. Optional filters are temporary, used just during the current partial render (as opposed to filters contributed to the PartialMarkupRenderer service 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:
addPartialMarkupRendererFilter in interface PageRenderQueue
Parameters:
filter - to add to the pipeline

renderPartial

public void renderPartial(MarkupWriter writer,
                          JSONObject reply)
Description copied from interface: PageRenderQueue
Performs a partial markup render, as configured via PageRenderQueue.initializeForPartialPageRender(org.apache.tapestry5.runtime.RenderCommand).

Specified by:
renderPartial in interface PageRenderQueue
Parameters:
writer - to which markup should be written
reply - JSONObject which will contain the partial response


Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.