net.sf.jasperreports.engine.fill
Class JRThreadSubreportRunner

java.lang.Object
  extended by net.sf.jasperreports.engine.fill.JRSubreportRunnable
      extended by net.sf.jasperreports.engine.fill.JRThreadSubreportRunner
All Implemented Interfaces:
java.lang.Runnable, JRSubreportRunner

public class JRThreadSubreportRunner
extends JRSubreportRunnable
implements JRSubreportRunner

Thread-based JRSubreportRunner implementation.

The subreport fill is launched in a new thread which coordinates suspend/resume actions with the master thread.

Version:
$Id: JRThreadSubreportRunner.java 5180 2012-03-29 13:23:12Z teodord $
Author:
Lucian Chirita (lucianc@users.sourceforge.net)

Constructor Summary
JRThreadSubreportRunner(JRFillSubreport fillSubreport, JRBaseFiller subreportFiller)
           
 
Method Summary
 void cancel()
          Cancels the current fill process.
 boolean isFilling()
          Decides whether the subreport filling has ended or not.
 void reset()
          Resets the runner, preparing it for a new fill.
 JRSubreportRunResult resume()
          Resumes the filling of a subreport.
 void run()
           
 JRSubreportRunResult start()
          Starts to fill the subreport.
 void suspend()
          Suspends the current fill.
protected  JRSubreportRunResult waitResult()
           
 
Methods inherited from class net.sf.jasperreports.engine.fill.JRSubreportRunnable
isRunning, runResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JRThreadSubreportRunner

public JRThreadSubreportRunner(JRFillSubreport fillSubreport,
                               JRBaseFiller subreportFiller)
Method Detail

isFilling

public boolean isFilling()
Description copied from interface: JRSubreportRunner
Decides whether the subreport filling has ended or not.

Specified by:
isFilling in interface JRSubreportRunner
Returns:
true if and only if the subreport filling has not ended

start

public JRSubreportRunResult start()
Description copied from interface: JRSubreportRunner
Starts to fill the subreport.

This method is always called by a thread owning the lock on the subreport filler.

Specified by:
start in interface JRSubreportRunner
Returns:
the result of the fill process

resume

public JRSubreportRunResult resume()
Description copied from interface: JRSubreportRunner
Resumes the filling of a subreport.

This method is called after the fill has been suspended by suspend and the subreport should continue on the new page.

This method is always called by a thread owning the lock on the subreport filler.

Specified by:
resume in interface JRSubreportRunner
Returns:
the result of the fill process

waitResult

protected JRSubreportRunResult waitResult()

reset

public void reset()
Description copied from interface: JRSubreportRunner
Resets the runner, preparing it for a new fill.

Specified by:
reset in interface JRSubreportRunner

cancel

public void cancel()
            throws JRException
Description copied from interface: JRSubreportRunner
Cancels the current fill process.

This method is called when a subreport is placed on a non splitting band and needs to rewind.

This method is always called by a thread owning the lock on the subreport filler.

Specified by:
cancel in interface JRSubreportRunner
Throws:
JRException

suspend

public void suspend()
             throws JRException
Description copied from interface: JRSubreportRunner
Suspends the current fill.

This method is called when the subreport reaches the end of a page and needs to wait for the master to create a new page.

This method is always called by a thread owning the lock on the subreport filler.

Specified by:
suspend in interface JRSubreportRunner
Throws:
JRException

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class JRSubreportRunnable


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com