Package org.apache.ofbiz.htmlreport
Class AbstractReportThread
java.lang.Object
java.lang.Thread
org.apache.ofbiz.htmlreport.AbstractReportThread
- All Implemented Interfaces:
Runnable
,InterfaceReportThread
- Direct Known Subclasses:
PricatParseExcelHtmlThread
,SampleHtmlThread
Provides a common Thread class for the reports.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractReportThread
(HttpServletRequest request, HttpServletResponse response, String name) Constructs a new report Thread with the given name. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an error object to the list of errors that occurred during the report.getError()
Returns the error exception in case there was an error during the execution of this Thread, null otherwise.List<?>
Returns a list of all errors that occurred during the report.protected Locale
Gets locale.protected InterfaceReport
Returns the report where the output of this Thread is written to.abstract String
Returns the part of the report that is ready for output.long
Returns the time this report has been running.org.safehaus.uuid.UUID
getUUID()
Returns the UUID of this report thread.boolean
hasError()
Returns if the report generated an error output.protected void
initHtmlReport
(HttpServletRequest request, HttpServletResponse response) Initialize a HTML report for this Thread.protected void
initHtmlReport
(HttpServletRequest request, HttpServletResponse response, boolean writeHtml, boolean isTransient) Initialize a HTML report for this Thread.protected void
initHtmlReport
(HttpServletRequest request, HttpServletResponse response, boolean writeHtml, boolean isTransient, String logFileName) Init html report.boolean
isDoomed()
Returns true if this thread is already "doomed" to be deleted.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.ofbiz.htmlreport.InterfaceReportThread
start
-
Constructor Details
-
AbstractReportThread
protected AbstractReportThread(HttpServletRequest request, HttpServletResponse response, String name) Constructs a new report Thread with the given name.
-
-
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 interfaceInterfaceReportThread
- Returns:
- the UUID of this report thread
-
addError
Adds an error object to the list of errors that occurred during the report.- Parameters:
obj
- the error object
-
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
Returns a list of all errors that occurred during the report.- Returns:
- an error list that occurred during the report
-
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
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
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 requestresponse
- the responsewriteHtml
- the write htmlisTransient
- the is transientlogFileName
- the log file name
-
getLocale
Gets locale.- Returns:
- the locale
-