Package net.sf.jasperreports.engine.fill
Class BaseFillHandle
java.lang.Object
net.sf.jasperreports.engine.fill.BaseFillHandle
- All Implemented Interfaces:
FillHandle
- Direct Known Subclasses:
AsynchronousFillHandle
Base class used to perform report filling asychronously.
An instance of this type can be used as a handle to an asychronous fill process. The main benefit of this method is that the filling process can be cancelled.
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected final Connectionprotected final JRDataSourceprotected final ReportFillerprotected final JasperReportprotected final JasperReportsContextprotected final List<AsynchronousFilllListener> protected final Objectprotected booleanprotected boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseFillHandle(JasperReportsContext jasperReportsContext, JasperReportSource reportSource, Map<String, Object> parameters, JRDataSource dataSource, Connection conn) protectedBaseFillHandle(JasperReportsContext jasperReportsContext, JasperReport jasperReport, Map<String, Object> parameters, JRDataSource dataSource, Connection conn) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFillListener(FillListener listener) Adds a fill listener to the filling process.voidaddListener(AsynchronousFilllListener listener) Adds a listener to the filling process.voidCancels the fill started by the handle.protected abstract ExecutorbooleanisPageFinal(int pageIdx) Determines wheter a page generated by the fill process is final or not.protected voidprotected voidprotected voidnotifyFinish(JasperPrint print) booleanremoveListener(AsynchronousFilllListener listener) Removes a listener from the filling process.voidStarts the filling process asychronously.
-
Field Details
-
jasperReportsContext
-
jasperReport
-
parameters
-
dataSource
-
conn
-
filler
-
listeners
-
started
protected boolean started -
running
protected boolean running -
cancelled
protected boolean cancelled -
lock
-
-
Constructor Details
-
BaseFillHandle
protected BaseFillHandle(JasperReportsContext jasperReportsContext, JasperReport jasperReport, Map<String, Object> parameters, JRDataSource dataSource, Connection conn) throws JRException- Throws:
JRException
-
BaseFillHandle
protected BaseFillHandle(JasperReportsContext jasperReportsContext, JasperReportSource reportSource, Map<String, Object> parameters, JRDataSource dataSource, Connection conn) throws JRException- Throws:
JRException
-
-
Method Details
-
addListener
Description copied from interface:FillHandleAdds a listener to the filling process.- Specified by:
addListenerin interfaceFillHandle- Parameters:
listener- the listener to be added
-
addFillListener
Description copied from interface:FillHandleAdds a fill listener to the filling process. The fill listener is notified of intermediate events that occur during the report generation.- Specified by:
addFillListenerin interfaceFillHandle- Parameters:
listener- the listener to add
-
removeListener
Description copied from interface:FillHandleRemoves a listener from the filling process.- Specified by:
removeListenerin interfaceFillHandle- Parameters:
listener- the listener to be removed- Returns:
- true if the listener was found and removed
-
startFill
public void startFill()Description copied from interface:FillHandleStarts the filling process asychronously.The filling can be launched on a new thread and the method exits after the execution is started.
When the filling finishes either in success or failure, the listeners are notified.
- Specified by:
startFillin interfaceFillHandle
-
getReportExecutor
-
cancellFill
Description copied from interface:FillHandleCancels the fill started by the handle.The method sends a cancel signal to the filling process. When the filling process will end, the listeners will be notified that the filling has been cancelled.
- Specified by:
cancellFillin interfaceFillHandle- Throws:
JRException
-
notifyFinish
-
notifyCancel
protected void notifyCancel() -
notifyError
-
isPageFinal
public boolean isPageFinal(int pageIdx) Description copied from interface:FillHandleDetermines wheter a page generated by the fill process is final or not.- Specified by:
isPageFinalin interfaceFillHandle- Parameters:
pageIdx- the page index- Returns:
- whether the page at the specified index is final or can be subject to future changes
- See Also:
-