Class AbstractReportThread

java.lang.Object
java.lang.Thread
org.apache.ofbiz.htmlreport.AbstractReportThread
All Implemented Interfaces:
Runnable, InterfaceReportThread
Direct Known Subclasses:
PricatParseExcelHtmlThread, SampleHtmlThread

public abstract class AbstractReportThread extends Thread implements InterfaceReportThread
Provides a common Thread class for the reports.
  • Constructor Details

  • Method Details

    • getUUID

      public org.safehaus.uuid.UUID getUUID()
      Description copied from interface: InterfaceReportThread
      Returns the UUID of this report thread.

      Specified by:
      getUUID in interface InterfaceReportThread
      Returns:
      the UUID of this report thread
    • addError

      public void addError(Object obj)
      Adds an error object to the list of errors that occurred during the report.
      Parameters:
      obj - the error object
    • getError

      public Throwable getError()
      Returns the error exception in case there was an error during the execution of this Thread, null otherwise.
      Returns:
      the error exception in case there was an error, null otherwise
    • getErrors

      public List<?> getErrors()
      Returns a list of all errors that occurred during the report.
      Returns:
      an error list that occurred during the report
    • getReportUpdate

      public abstract String getReportUpdate()
      Returns the part of the report that is ready for output.
      Returns:
      the part of the report that is ready for output
    • getRuntime

      public long getRuntime()
      Returns the time this report has been running.
      Returns:
      the time this report has been running
    • hasError

      public boolean hasError()
      Returns if the report generated an error output.
      Returns:
      true if the report generated an error, otherwise false
    • isDoomed

      public boolean isDoomed()
      Returns true if this thread is already "doomed" to be deleted. A OFBiz daemon Thread (the "Grim Reaper") will collect all doomed Threads, i.e. threads that are not longer active for some time.
      Returns:
      true if this thread is already "doomed" to be deleted
    • getReport

      protected InterfaceReport getReport()
      Returns the report where the output of this Thread is written to.
      Returns:
      the report where the output of this Thread is written to
    • initHtmlReport

      protected void initHtmlReport(HttpServletRequest request, HttpServletResponse response)
      Initialize a HTML report for this Thread.
    • initHtmlReport

      protected void initHtmlReport(HttpServletRequest request, HttpServletResponse response, boolean writeHtml, boolean isTransient)
      Initialize a HTML report for this Thread.
    • initHtmlReport

      protected void initHtmlReport(HttpServletRequest request, HttpServletResponse response, boolean writeHtml, boolean isTransient, String logFileName)
      Init html report.
      Parameters:
      request - the request
      response - the response
      writeHtml - the write html
      isTransient - the is transient
      logFileName - the log file name
    • getLocale

      protected Locale getLocale()
      Gets locale.
      Returns:
      the locale