Package org.apache.tapestry5.internal.services

# Interface PageRenderQueue

All Known Implementing Classes:
  `PageRenderQueueImpl`

public interface PageRenderQueue
A wrapper around `RenderQueue`, but referencable as a (per-thread) service. This service is scoped so that we can tell it what to render in one method, then have it do the render in another. Part of an elaborate scheme to keep certain interfaces public and other closely related ones private.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addPartialMarkupRendererFilter(PartialMarkupRendererFilter filter)`
  Adds an optional filter to the rendering.
  `void`
  `addPartialRenderer(RenderCommand renderer)`
  Adds a rendering command to the queue of rendering commands.
  `Page`
  `getRenderingPage()`
  Returns the page that is rendering markup content.
  `void`
  `initializeForCompletePage(Page page)`
  Initializes the queue for rendering of a complete page.
  `boolean`
  `isPartialRenderInitialized()`
  Returns true if either `addPartialRenderer(org.apache.tapestry5.runtime.RenderCommand)` or `addPartialMarkupRendererFilter(org.apache.tapestry5.services.PartialMarkupRendererFilter)` has been invoked.
  `void`
  `render(MarkupWriter writer)`
  Render to the markup writer, as setup by the `initializeForCompletePage(org.apache.tapestry5.internal.structure.Page)` or `addPartialRenderer(org.apache.tapestry5.runtime.RenderCommand)` methods.
  `void`
  `renderPartial(MarkupWriter writer, JSONObject reply)`
  Performs a partial markup render, as configured via `addPartialRenderer(org.apache.tapestry5.runtime.RenderCommand)`.
  `void`
  `setRenderingPage(Page page)`
  Sets the default page that will render the response.

- ## Method Details

  - ### initializeForCompletePage

    void initializeForCompletePage(Page page)
    Initializes the queue for rendering of a complete page.

  - ### setRenderingPage

    void setRenderingPage(Page page)
    Sets the default page that will render the response.

  - ### getRenderingPage

    Page getRenderingPage()
    Returns the page that is rendering markup content.

  - ### addPartialRenderer

    void addPartialRenderer(RenderCommand renderer)
    Adds a rendering command to the queue of rendering commands. This must not be invoked until after the rendering page has been identified.
    Parameters:
      `renderer` - responsible for rendering a portion of the final markup

  - ### isPartialRenderInitialized

    boolean isPartialRenderInitialized()
    Returns true if either `addPartialRenderer(org.apache.tapestry5.runtime.RenderCommand)` or `addPartialMarkupRendererFilter(org.apache.tapestry5.services.PartialMarkupRendererFilter)` has been invoked.

  - ### render

    void render(MarkupWriter writer)
    Render to the markup writer, as setup by the `initializeForCompletePage(org.apache.tapestry5.internal.structure.Page)` or `addPartialRenderer(org.apache.tapestry5.runtime.RenderCommand)` methods.
    Parameters:
      `writer` - to write markup to

  - ### renderPartial

    void renderPartial(MarkupWriter writer, JSONObject reply)
    Performs a partial markup render, as configured via `addPartialRenderer(org.apache.tapestry5.runtime.RenderCommand)`.
    Parameters:
      `writer` - to which markup should be written
      `reply` - JSONObject which will contain the partial response

  - ### addPartialMarkupRendererFilter

    void addPartialMarkupRendererFilter(PartialMarkupRendererFilter filter)
    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.
    Parameters:
      `filter` - to add to the pipeline