Class AbstractReportProcessor
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.layout.output.AbstractReportProcessor
-
- All Implemented Interfaces:
ReportProcessor
- Direct Known Subclasses:
CSVProcessor
,FastCsvExportProcessor
,FastExcelExportProcessor
,FastHtmlExportProcessor
,FlowReportProcessor
,PageableReportProcessor
,StreamReportProcessor
,XMLProcessor
public abstract class AbstractReportProcessor extends Object implements ReportProcessor
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
COMMIT_RATE
protected static int
MAX_EVENTS_PER_RUN
protected static int
MIN_ROWS_PER_EVENT
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractReportProcessor(MasterReport report, OutputProcessor outputProcessor)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addReportProgressListener(ReportProgressListener l)
Adds a repagination listener.protected int
calculatePageCount(ProcessState state)
void
cancel()
protected void
checkInterrupted()
Checks whether the current thread is interrupted.void
close()
protected abstract OutputFunction
createLayoutManager()
protected DefaultProcessingContext
createProcessingContext()
protected void
fireProcessingFinished(ReportProgressEvent state)
Sends a repagination update to all registered listeners.protected void
fireProcessingStarted(ReportProgressEvent state)
Sends a repagination update to all registered listeners.protected void
fireStateUpdate(ReportProgressEvent state)
Sends a repagination update to all registered listeners.org.pentaho.reporting.libraries.base.config.Configuration
getConfiguration()
int
getLogicalPageCount()
protected PageState
getLogicalPageState(int page)
OutputProcessor
getOutputProcessor()
protected OutputProcessorMetaData
getOutputProcessorMetaData()
int
getPhysicalPageCount()
protected PageState
getPhysicalPageState(int page)
protected ProcessStateHandle
getProcessStateHandle()
protected MasterReport
getReport()
boolean
isFullStreamingProcessor()
boolean
isHandleInterruptedState()
Returns whether the processor should check the threads interrupted state.boolean
isPaginated()
boolean
isQueryLimitReached()
protected static boolean
isStrictErrorHandling(org.pentaho.reporting.libraries.base.config.Configuration config)
Checks whether report processing should be aborted when an exception occurs.boolean
paginate()
protected void
prepareReportProcessing()
PageState
processPage(PageState pageState, boolean performOutput)
protected ProcessState
processPrepareLevels(ProcessState state, int maxRows)
Processes all prepare levels to compute the function values.void
processReport()
void
removeReportProgressListener(ReportProgressListener l)
Removes a repagination listener.void
setFullStreamingProcessor(boolean fullStreamingProcessor)
void
setHandleInterruptedState(boolean handleInterruptedState)
Defines, whether the processor should check the threads interrupted state.void
setQueryLimitReached(boolean queryLimitReached)
-
-
-
Field Detail
-
MAX_EVENTS_PER_RUN
protected static final int MAX_EVENTS_PER_RUN
- See Also:
- Constant Field Values
-
MIN_ROWS_PER_EVENT
protected static final int MIN_ROWS_PER_EVENT
- See Also:
- Constant Field Values
-
COMMIT_RATE
protected static final int COMMIT_RATE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractReportProcessor
protected AbstractReportProcessor(MasterReport report, OutputProcessor outputProcessor) throws ReportProcessingException
- Throws:
ReportProcessingException
-
-
Method Detail
-
getProcessStateHandle
protected ProcessStateHandle getProcessStateHandle()
-
getReport
protected MasterReport getReport()
-
getOutputProcessor
public OutputProcessor getOutputProcessor()
-
getOutputProcessorMetaData
protected OutputProcessorMetaData getOutputProcessorMetaData()
-
addReportProgressListener
public void addReportProgressListener(ReportProgressListener l)
Adds a repagination listener. This listener will be informed of pagination events.- Specified by:
addReportProgressListener
in interfaceReportProcessor
- Parameters:
l
- the listener.
-
removeReportProgressListener
public void removeReportProgressListener(ReportProgressListener l)
Removes a repagination listener.- Specified by:
removeReportProgressListener
in interfaceReportProcessor
- Parameters:
l
- the listener.
-
fireStateUpdate
protected void fireStateUpdate(ReportProgressEvent state)
Sends a repagination update to all registered listeners.- Parameters:
state
- the state.
-
fireProcessingStarted
protected void fireProcessingStarted(ReportProgressEvent state)
Sends a repagination update to all registered listeners.- Parameters:
state
- the state.
-
fireProcessingFinished
protected void fireProcessingFinished(ReportProgressEvent state)
Sends a repagination update to all registered listeners.- Parameters:
state
- the state.
-
isHandleInterruptedState
public boolean isHandleInterruptedState()
Returns whether the processor should check the threads interrupted state. If this is set to true and the thread was interrupted, then the report processing is aborted.- Specified by:
isHandleInterruptedState
in interfaceReportProcessor
- Returns:
- true, if the processor should check the current thread state, false otherwise.
-
setHandleInterruptedState
public void setHandleInterruptedState(boolean handleInterruptedState)
Defines, whether the processor should check the threads interrupted state. If this is set to true and the thread was interrupted, then the report processing is aborted.- Specified by:
setHandleInterruptedState
in interfaceReportProcessor
- Parameters:
handleInterruptedState
- true, if the processor should check the current thread state, false otherwise.
-
checkInterrupted
protected final void checkInterrupted() throws ReportInterruptedException
Checks whether the current thread is interrupted.- Throws:
ReportInterruptedException
- if the thread is interrupted to abort the report processing.
-
close
public void close()
- Specified by:
close
in interfaceReportProcessor
-
cancel
public void cancel()
-
getConfiguration
public org.pentaho.reporting.libraries.base.config.Configuration getConfiguration()
- Specified by:
getConfiguration
in interfaceReportProcessor
-
createProcessingContext
protected DefaultProcessingContext createProcessingContext() throws ReportProcessingException
- Throws:
ReportProcessingException
-
processPrepareLevels
protected ProcessState processPrepareLevels(ProcessState state, int maxRows) throws ReportProcessingException
Processes all prepare levels to compute the function values.- Parameters:
state
- the state state with which we beginn the processing.maxRows
- the number of rows in the table model.- Returns:
- the finish state for the current level.
- Throws:
ReportProcessingException
- if processing failed or if there are exceptions during the function execution.
-
createLayoutManager
protected abstract OutputFunction createLayoutManager()
-
prepareReportProcessing
protected void prepareReportProcessing() throws ReportProcessingException
- Throws:
ReportProcessingException
-
setFullStreamingProcessor
public void setFullStreamingProcessor(boolean fullStreamingProcessor)
-
isFullStreamingProcessor
public boolean isFullStreamingProcessor()
-
calculatePageCount
protected int calculatePageCount(ProcessState state)
-
isPaginated
public boolean isPaginated()
-
getLogicalPageState
protected PageState getLogicalPageState(int page)
-
getPhysicalPageState
protected PageState getPhysicalPageState(int page)
-
isStrictErrorHandling
protected static boolean isStrictErrorHandling(org.pentaho.reporting.libraries.base.config.Configuration config)
Checks whether report processing should be aborted when an exception occurs.- Parameters:
config
- the configuration.- Returns:
- if strict error handling is enabled.
-
processPage
public PageState processPage(PageState pageState, boolean performOutput) throws ReportProcessingException
- Specified by:
processPage
in interfaceReportProcessor
- Throws:
ReportProcessingException
-
paginate
public boolean paginate() throws ReportProcessingException
- Throws:
ReportProcessingException
-
processReport
public void processReport() throws ReportProcessingException
- Specified by:
processReport
in interfaceReportProcessor
- Throws:
ReportProcessingException
-
getLogicalPageCount
public int getLogicalPageCount()
-
getPhysicalPageCount
public int getPhysicalPageCount()
-
isQueryLimitReached
public boolean isQueryLimitReached()
-
setQueryLimitReached
public void setQueryLimitReached(boolean queryLimitReached)
-
-