net.sf.jasperreports.web.servlets

## Class AsyncJasperPrintAccessor

- java.lang.Object
- - net.sf.jasperreports.web.servlets.AsyncJasperPrintAccessor

- All Implemented Interfaces:
    AsynchronousFilllListener, FillListener, JasperPrintAccessor

      public class AsyncJasperPrintAccessor
      extends java.lang.Object
      implements JasperPrintAccessor, AsynchronousFilllListener, FillListener

  Generated report accessor used for asynchronous report executions that publishes pages before the entire report has been generated.
  Version:
    $Id: AsyncJasperPrintAccessor.java 6570 2013-10-08 12:28:01Z lucianc $
  Author:
    Lucian Chirita (lucianc@users.sourceforge.net)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AsyncJasperPrintAccessor(FillHandle fillHandle)` Create a report accessor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `JasperPrint` | `getFinalJasperPrint()` Returns the generated report, ensuring before that the report generation has ended.
    `JasperPrint` | `getJasperPrint()` Returns the generated report.
    `ReportExecutionStatus` | `getReportStatus()` Returns the status of the report execution.
    `protected void` | `lock()`
    `void` | `pageGenerated(JasperPrint jasperPrint, int pageIndex)` Called when a report page has been generated.
    `ReportPageStatus` | `pageStatus(int pageIdx, java.lang.Long pageTimestamp)` Ensures that a page is available in the generated report.
    `void` | `pageUpdated(JasperPrint jasperPrint, int pageIndex)` Called when a previously generated page has been updated, usually by evaluating a delayed element.
    `void` | `reportCancelled()` Called when the report is cancelled.
    `void` | `reportFillError(java.lang.Throwable t)` Called when the filling process exits in error.
    `void` | `reportFinished(JasperPrint jasperPrint)` Called when the report filling is done.
    `protected void` | `unlock()`
    `boolean` | `waitForFinalJasperPrint(int milliseconds)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AsyncJasperPrintAccessor

          public AsyncJasperPrintAccessor(FillHandle fillHandle)

      Create a report accessor.
      Parameters:
        `fillHandle` - the asynchronous fill handle used by this accessor

  - ### Method Detail

    - #### lock

          protected void lock()

    - #### unlock

          protected void unlock()

    - #### pageStatus

          public ReportPageStatus pageStatus(int pageIdx,
                                    java.lang.Long pageTimestamp)

      Description copied from interface: `JasperPrintAccessor`
      Ensures that a page is available in the generated report.
      Specified by:
        `pageStatus` in interface `JasperPrintAccessor`
      Parameters:
        `pageIdx` - the page index
      Returns:
        the status of the requested page

    - #### getJasperPrint

          public JasperPrint getJasperPrint()

      Description copied from interface: `JasperPrintAccessor`
      Returns the generated report.
      Specified by:
        `getJasperPrint` in interface `JasperPrintAccessor`
      Returns:
        the generated report

    - #### waitForFinalJasperPrint

          public boolean waitForFinalJasperPrint(int milliseconds)

    - #### getFinalJasperPrint

          public JasperPrint getFinalJasperPrint()

      Description copied from interface: `JasperPrintAccessor`
      Returns the generated report, ensuring before that the report generation has ended.
      Specified by:
        `getFinalJasperPrint` in interface `JasperPrintAccessor`
      Returns:
        the final generated report

    - #### reportFinished

          public void reportFinished(JasperPrint jasperPrint)

      Description copied from interface: `AsynchronousFilllListener`
      Called when the report filling is done.
      Specified by:
        `reportFinished` in interface `AsynchronousFilllListener`
      Parameters:
        `jasperPrint` - the filled report

    - #### reportCancelled

          public void reportCancelled()

      Description copied from interface: `AsynchronousFilllListener`
      Called when the report is cancelled.
      Specified by:
        `reportCancelled` in interface `AsynchronousFilllListener`

    - #### reportFillError

          public void reportFillError(java.lang.Throwable t)

      Description copied from interface: `AsynchronousFilllListener`
      Called when the filling process exits in error.
      Specified by:
        `reportFillError` in interface `AsynchronousFilllListener`
      Parameters:
        `t` - the exception

    - #### pageGenerated

          public void pageGenerated(JasperPrint jasperPrint,
                           int pageIndex)

      Description copied from interface: `FillListener`
      Called when a report page has been generated. The page might not be final due to delayed evaluation elements.
      Specified by:
        `pageGenerated` in interface `FillListener`
      Parameters:
        `jasperPrint` - the report that is currently generating
        `pageIndex` - the index of the page that has been generated

    - #### pageUpdated

          public void pageUpdated(JasperPrint jasperPrint,
                         int pageIndex)

      Description copied from interface: `FillListener`
      Called when a previously generated page has been updated, usually by evaluating a delayed element.
      Specified by:
        `pageUpdated` in interface `FillListener`
      Parameters:
        `jasperPrint` - the report that is currently generating
        `pageIndex` - the index of the page that has been updated

    - #### getReportStatus

          public ReportExecutionStatus getReportStatus()

      Description copied from interface: `JasperPrintAccessor`
      Returns the status of the report execution.
      Specified by:
        `getReportStatus` in interface `JasperPrintAccessor`
      Returns:
        the status of the report execution

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com