|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jasperreports.engine.fill.BaseFillHandle
public abstract class BaseFillHandle
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.
Nested Class Summary | |
---|---|
protected class |
BaseFillHandle.ReportFiller
|
Field Summary | |
---|---|
protected boolean |
cancelled
|
protected java.sql.Connection |
conn
|
protected JRDataSource |
dataSource
|
protected JRBaseFiller |
filler
|
protected JasperReport |
jasperReport
|
protected JasperReportsContext |
jasperReportsContext
|
protected java.util.List<AsynchronousFilllListener> |
listeners
|
protected java.lang.Object |
lock
|
protected java.util.Map<java.lang.String,java.lang.Object> |
parameters
|
protected boolean |
running
|
protected boolean |
started
|
Constructor Summary | |
---|---|
protected |
BaseFillHandle(JasperReportsContext jasperReportsContext,
JasperReport jasperReport,
java.util.Map<java.lang.String,java.lang.Object> parameters,
JRDataSource dataSource,
java.sql.Connection conn)
|
Method Summary | |
---|---|
void |
addFillListener(FillListener listener)
Adds a fill listener to the filling process. |
void |
addListener(AsynchronousFilllListener listener)
Adds a listener to the filling process. |
void |
cancellFill()
Cancels the fill started by the handle. |
protected abstract java.util.concurrent.Executor |
getReportExecutor()
|
boolean |
isPageFinal(int pageIdx)
Determines wheter a page generated by the fill process is final or not. |
protected void |
notifyCancel()
|
protected void |
notifyError(java.lang.Throwable e)
|
protected void |
notifyFinish(JasperPrint print)
|
boolean |
removeListener(AsynchronousFilllListener listener)
Removes a listener from the filling process. |
void |
startFill()
Starts the filling process asychronously. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final JasperReportsContext jasperReportsContext
protected final JasperReport jasperReport
protected final java.util.Map<java.lang.String,java.lang.Object> parameters
protected final JRDataSource dataSource
protected final java.sql.Connection conn
protected final JRBaseFiller filler
protected final java.util.List<AsynchronousFilllListener> listeners
protected boolean started
protected boolean running
protected boolean cancelled
protected final java.lang.Object lock
Constructor Detail |
---|
protected BaseFillHandle(JasperReportsContext jasperReportsContext, JasperReport jasperReport, java.util.Map<java.lang.String,java.lang.Object> parameters, JRDataSource dataSource, java.sql.Connection conn) throws JRException
JRException
Method Detail |
---|
public void addListener(AsynchronousFilllListener listener)
FillHandle
addListener
in interface FillHandle
listener
- the listener to be addedpublic void addFillListener(FillListener listener)
FillHandle
addFillListener
in interface FillHandle
listener
- the listener to addpublic boolean removeListener(AsynchronousFilllListener listener)
FillHandle
removeListener
in interface FillHandle
listener
- the listener to be removed
public void startFill()
FillHandle
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.
startFill
in interface FillHandle
protected abstract java.util.concurrent.Executor getReportExecutor()
public void cancellFill() throws JRException
FillHandle
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.
cancellFill
in interface FillHandle
JRException
protected void notifyFinish(JasperPrint print)
protected void notifyCancel()
protected void notifyError(java.lang.Throwable e)
public boolean isPageFinal(int pageIdx)
FillHandle
isPageFinal
in interface FillHandle
pageIdx
- the page index
FillListener.pageUpdated(JasperPrint, int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |