|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jasperreports.engine.fill.AsynchronousFillHandle
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.
Field Summary | |
protected boolean |
cancelled
|
protected java.sql.Connection |
conn
|
protected JRDataSource |
dataSource
|
protected JRBaseFiller |
filler
|
protected java.lang.Thread |
fillThread
|
protected JasperReport |
jasperReport
|
protected java.util.List |
listeners
|
protected java.lang.Object |
lock
|
protected java.util.Map |
parameters
|
protected boolean |
running
|
protected boolean |
started
|
Constructor Summary | |
protected |
AsynchronousFillHandle(JasperReport jasperReport,
java.util.Map parameters,
java.sql.Connection conn)
|
protected |
AsynchronousFillHandle(JasperReport jasperReport,
java.util.Map parameters,
JRDataSource dataSource)
|
Method Summary | |
void |
addListener(AsynchronousFilllListener listener)
Adds a listener to the filling process. |
void |
cancellFill()
Cancels the fill started by the handle. |
static AsynchronousFillHandle |
createHandle(JasperReport jasperReport,
java.util.Map parameters,
java.sql.Connection conn)
Creates an asychronous filling handle. |
static AsynchronousFillHandle |
createHandle(JasperReport jasperReport,
java.util.Map parameters,
JRDataSource dataSource)
Creates an asychronous filling handle. |
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 JasperReport jasperReport
protected final java.util.Map parameters
protected final JRDataSource dataSource
protected final java.sql.Connection conn
protected final JRBaseFiller filler
protected final java.util.List listeners
protected java.lang.Thread fillThread
protected boolean started
protected boolean running
protected boolean cancelled
protected final java.lang.Object lock
Constructor Detail |
protected AsynchronousFillHandle(JasperReport jasperReport, java.util.Map parameters, JRDataSource dataSource) throws JRException
protected AsynchronousFillHandle(JasperReport jasperReport, java.util.Map parameters, java.sql.Connection conn) throws JRException
Method Detail |
public void addListener(AsynchronousFilllListener listener)
listener
- the listener to be addedpublic boolean removeListener(AsynchronousFilllListener listener)
listener
- the listener to be removed
public void startFill()
The filling is launched on a new thread and the method exits after the thread is started.
When the filling finishes either in success or failure, the listeners are notified.
public void cancellFill() throws JRException
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.
JRException
protected void notifyFinish(JasperPrint print)
protected void notifyCancel()
protected void notifyError(java.lang.Throwable e)
public static AsynchronousFillHandle createHandle(JasperReport jasperReport, java.util.Map parameters, JRDataSource dataSource) throws JRException
jasperReport
- the reportparameters
- the parameter mapdataSource
- the data source
JRException
public static AsynchronousFillHandle createHandle(JasperReport jasperReport, java.util.Map parameters, java.sql.Connection conn) throws JRException
jasperReport
- the reportparameters
- the parameter mapconn
- the connection
JRException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |