Package net.sf.jasperreports.engine.fill
Class AsynchronousFillHandle
- java.lang.Object
-
- net.sf.jasperreports.engine.fill.BaseFillHandle
-
- net.sf.jasperreports.engine.fill.AsynchronousFillHandle
-
- All Implemented Interfaces:
FillHandle
public class AsynchronousFillHandle extends BaseFillHandle
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 Modifier and Type Class Description protected class
AsynchronousFillHandle.ThreadExecutor
-
Nested classes/interfaces inherited from class net.sf.jasperreports.engine.fill.BaseFillHandle
BaseFillHandle.ReportFill
-
-
Field Summary
Fields Modifier and Type Field Description protected Thread
fillThread
protected Integer
priority
static String
PROPERTY_REPORT_ASYNC
A property that determines whether a report can be generated and displayed asynchronously in a viewer.protected String
threadName
-
Fields inherited from class net.sf.jasperreports.engine.fill.BaseFillHandle
cancelled, conn, dataSource, filler, jasperReport, jasperReportsContext, listeners, lock, parameters, running, started
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AsynchronousFillHandle(JasperReportsContext jasperReportsContext, JasperReportSource reportSource, Map<String,Object> parameters, JRDataSource dataSource, Connection conn)
protected
AsynchronousFillHandle(JasperReportsContext jasperReportsContext, JasperReport jasperReport, Map<String,Object> parameters)
protected
AsynchronousFillHandle(JasperReportsContext jasperReportsContext, JasperReport jasperReport, Map<String,Object> parameters, Connection conn)
protected
AsynchronousFillHandle(JasperReportsContext jasperReportsContext, JasperReport jasperReport, Map<String,Object> parameters, JRDataSource dataSource)
protected
AsynchronousFillHandle(JasperReportsContext jasperReportsContext, JasperReport jasperReport, Map<String,Object> parameters, JRDataSource dataSource, Connection conn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AsynchronousFillHandle
createHandle(JasperReport jasperReport, Map<String,Object> parameters)
static AsynchronousFillHandle
createHandle(JasperReport jasperReport, Map<String,Object> parameters, Connection conn)
static AsynchronousFillHandle
createHandle(JasperReport jasperReport, Map<String,Object> parameters, JRDataSource dataSource)
static AsynchronousFillHandle
createHandle(JasperReportsContext jasperReportsContext, JasperReportSource reportSource, Map<String,Object> parameters)
static AsynchronousFillHandle
createHandle(JasperReportsContext jasperReportsContext, JasperReportSource reportSource, Map<String,Object> parameters, Connection conn)
static AsynchronousFillHandle
createHandle(JasperReportsContext jasperReportsContext, JasperReportSource reportSource, Map<String,Object> parameters, JRDataSource dataSource)
static AsynchronousFillHandle
createHandle(JasperReportsContext jasperReportsContext, JasperReport jasperReport, Map<String,Object> parameters)
Creates an asychronous filling handle.static AsynchronousFillHandle
createHandle(JasperReportsContext jasperReportsContext, JasperReport jasperReport, Map<String,Object> parameters, Connection conn)
Creates an asychronous filling handle.static AsynchronousFillHandle
createHandle(JasperReportsContext jasperReportsContext, JasperReport jasperReport, Map<String,Object> parameters, JRDataSource dataSource)
Creates an asychronous filling handle.protected Executor
getReportExecutor()
Returns an executor that creates a new thread to perform the report execution.void
setPriority(int priority)
Sets the priority of the filler thread.void
setThreadName(String name)
Sets the name of the filler thread.-
Methods inherited from class net.sf.jasperreports.engine.fill.BaseFillHandle
addFillListener, addListener, cancellFill, isPageFinal, notifyCancel, notifyError, notifyFinish, removeListener, startFill
-
-
-
-
Field Detail
-
PROPERTY_REPORT_ASYNC
public static final String PROPERTY_REPORT_ASYNC
A property that determines whether a report can be generated and displayed asynchronously in a viewer. Asynchronous report generation implies displaying report pages before the report is complete.- See Also:
- Constant Field Values
-
fillThread
protected Thread fillThread
-
priority
protected Integer priority
-
threadName
protected String threadName
-
-
Constructor Detail
-
AsynchronousFillHandle
protected AsynchronousFillHandle(JasperReportsContext jasperReportsContext, JasperReport jasperReport, Map<String,Object> parameters, JRDataSource dataSource) throws JRException
- Throws:
JRException
-
AsynchronousFillHandle
protected AsynchronousFillHandle(JasperReportsContext jasperReportsContext, JasperReport jasperReport, Map<String,Object> parameters, Connection conn) throws JRException
- Throws:
JRException
-
AsynchronousFillHandle
protected AsynchronousFillHandle(JasperReportsContext jasperReportsContext, JasperReport jasperReport, Map<String,Object> parameters) throws JRException
- Throws:
JRException
-
AsynchronousFillHandle
protected AsynchronousFillHandle(JasperReportsContext jasperReportsContext, JasperReport jasperReport, Map<String,Object> parameters, JRDataSource dataSource, Connection conn) throws JRException
- Throws:
JRException
-
AsynchronousFillHandle
protected AsynchronousFillHandle(JasperReportsContext jasperReportsContext, JasperReportSource reportSource, Map<String,Object> parameters, JRDataSource dataSource, Connection conn) throws JRException
- Throws:
JRException
-
-
Method Detail
-
getReportExecutor
protected Executor getReportExecutor()
Returns an executor that creates a new thread to perform the report execution.- Specified by:
getReportExecutor
in classBaseFillHandle
-
createHandle
public static AsynchronousFillHandle createHandle(JasperReportsContext jasperReportsContext, JasperReport jasperReport, Map<String,Object> parameters, JRDataSource dataSource) throws JRException
Creates an asychronous filling handle.- Parameters:
jasperReportsContext
- the contextjasperReport
- the reportparameters
- the parameter mapdataSource
- the data source- Returns:
- the handle
- Throws:
JRException
-
createHandle
public static AsynchronousFillHandle createHandle(JasperReportsContext jasperReportsContext, JasperReportSource reportSource, Map<String,Object> parameters, JRDataSource dataSource) throws JRException
- Throws:
JRException
-
createHandle
public static AsynchronousFillHandle createHandle(JasperReportsContext jasperReportsContext, JasperReport jasperReport, Map<String,Object> parameters, Connection conn) throws JRException
Creates an asychronous filling handle.- Parameters:
jasperReportsContext
- the contextjasperReport
- the reportparameters
- the parameter mapconn
- the connection- Returns:
- the handle
- Throws:
JRException
-
createHandle
public static AsynchronousFillHandle createHandle(JasperReportsContext jasperReportsContext, JasperReportSource reportSource, Map<String,Object> parameters, Connection conn) throws JRException
- Throws:
JRException
-
createHandle
public static AsynchronousFillHandle createHandle(JasperReportsContext jasperReportsContext, JasperReport jasperReport, Map<String,Object> parameters) throws JRException
Creates an asychronous filling handle.- Parameters:
jasperReportsContext
- the contextjasperReport
- the reportparameters
- the parameter map- Returns:
- the handle
- Throws:
JRException
-
createHandle
public static AsynchronousFillHandle createHandle(JasperReportsContext jasperReportsContext, JasperReportSource reportSource, Map<String,Object> parameters) throws JRException
- Throws:
JRException
-
createHandle
public static AsynchronousFillHandle createHandle(JasperReport jasperReport, Map<String,Object> parameters, JRDataSource dataSource) throws JRException
-
createHandle
public static AsynchronousFillHandle createHandle(JasperReport jasperReport, Map<String,Object> parameters, Connection conn) throws JRException
- Throws:
JRException
- See Also:
createHandle(JasperReportsContext, JasperReport, Map, Connection)
-
createHandle
public static AsynchronousFillHandle createHandle(JasperReport jasperReport, Map<String,Object> parameters) throws JRException
- Throws:
JRException
- See Also:
createHandle(JasperReportsContext, JasperReport, Map)
-
setPriority
public void setPriority(int priority)
Sets the priority of the filler thread.- Parameters:
priority
- the filler thread priority.- See Also:
Thread.setPriority(int)
-
setThreadName
public void setThreadName(String name)
Sets the name of the filler thread.- Parameters:
name
- the filler thread name.- See Also:
Thread.setName(java.lang.String)
-
-