1 28 package net.sf.jasperreports.engine.fill; 29 30 31 39 public abstract class JRSubreportRunnable implements Runnable 40 { 41 private final JRFillSubreport fillSubreport; 42 43 private Throwable error; 44 private boolean running; 45 46 protected JRSubreportRunnable(JRFillSubreport fillSubreport) 47 { 48 this.fillSubreport = fillSubreport; 49 } 50 51 protected JRSubreportRunResult runResult() 52 { 53 return new JRSubreportRunResult(!running, error); 54 } 55 56 public void run() 57 { 58 running = true; 59 error = null; 60 61 try 62 { 63 fillSubreport.fillSubreport(); 64 } 65 catch(JRFillInterruptedException e) 66 { 67 } 69 catch(Throwable t) 70 { 71 error = t; 72 } 73 74 running = false; 75 } 76 77 protected boolean isRunning() 78 { 79 return running; 80 } 81 } 82 | Popular Tags |