|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.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 Connection |
conn
|
protected JRDataSource |
dataSource
|
protected JRBaseFiller |
filler
|
protected JasperReport |
jasperReport
|
protected JasperReportsContext |
jasperReportsContext
|
protected List<AsynchronousFilllListener> |
listeners
|
protected Object |
lock
|
protected Map<String,Object> |
parameters
|
protected boolean |
running
|
protected boolean |
started
|
| Constructor Summary | |
|---|---|
protected |
BaseFillHandle(JasperReportsContext jasperReportsContext,
JasperReport jasperReport,
Map<String,Object> parameters,
JRDataSource dataSource,
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 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(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 Map<String,Object> parameters
protected final JRDataSource dataSource
protected final Connection conn
protected final JRBaseFiller filler
protected final List<AsynchronousFilllListener> listeners
protected boolean started
protected boolean running
protected boolean cancelled
protected final Object lock
| Constructor Detail |
|---|
protected BaseFillHandle(JasperReportsContext jasperReportsContext,
JasperReport jasperReport,
Map<String,Object> parameters,
JRDataSource dataSource,
Connection conn)
throws JRException
JRException| Method Detail |
|---|
public void addListener(AsynchronousFilllListener listener)
FillHandle
addListener in interface FillHandlelistener - the listener to be addedpublic void addFillListener(FillListener listener)
FillHandle
addFillListener in interface FillHandlelistener - the listener to addpublic boolean removeListener(AsynchronousFilllListener listener)
FillHandle
removeListener in interface FillHandlelistener - the listener to be removed
public void startFill()
FillHandleThe 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 FillHandleprotected abstract Executor getReportExecutor()
public void cancellFill()
throws JRException
FillHandleThe 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 FillHandleJRExceptionprotected void notifyFinish(JasperPrint print)
protected void notifyCancel()
protected void notifyError(Throwable e)
public boolean isPageFinal(int pageIdx)
FillHandle
isPageFinal in interface FillHandlepageIdx - the page index
FillListener.pageUpdated(JasperPrint, int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||