/[schmitzm]/branches/2.3.KECK/src/skrueger/geotools/RenderingExecutor.java
ViewVC logotype

Diff of /branches/2.3.KECK/src/skrueger/geotools/RenderingExecutor.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 510 by alfonx, Thu Nov 5 17:39:37 2009 UTC revision 513 by alfonx, Mon Nov 9 11:17:34 2009 UTC
# Line 81  public class RenderingExecutor { Line 81  public class RenderingExecutor {
81      private final ExecutorService taskExecutor;      private final ExecutorService taskExecutor;
82      private final ScheduledExecutorService watchExecutor;      private final ScheduledExecutorService watchExecutor;
83    
84      /** The default interval (milliseconds) for polling the result of a rendering task */  //    /** The default interval (milliseconds) for polling the result of a rendering task */
85      public static final long DEFAULT_POLLING_INTERVAL = 100L;  //    public static final long DEFAULT_POLLING_INTERVAL = 300L;
86    
87      private long pollingInterval;      private long pollingInterval;
88    
# Line 218  public class RenderingExecutor { Line 218  public class RenderingExecutor {
218       * Constructor. Creates a new executor to service the specified map pane.       * Constructor. Creates a new executor to service the specified map pane.
219       *       *
220       * @param mapPane the map pane to be serviced       * @param mapPane the map pane to be serviced
221         * @param l
222       */       */
223      public RenderingExecutor(final XMapPane mapPane) {          public RenderingExecutor(final XMapPane mapPane, long pollingInterval) {
224          taskRunning = new AtomicBoolean(false);          taskRunning = new AtomicBoolean(false);
225          this.mapPane = mapPane;          this.mapPane = mapPane;
226          taskExecutor = Executors.newSingleThreadExecutor();          taskExecutor = Executors.newSingleThreadExecutor();
227          watchExecutor = Executors.newSingleThreadScheduledExecutor();          watchExecutor = Executors.newSingleThreadScheduledExecutor();
228          pollingInterval = DEFAULT_POLLING_INTERVAL;          this.pollingInterval = pollingInterval;
229          cancelLatch = new CountDownLatch(0);          cancelLatch = new CountDownLatch(0);
230      }      }
231    
# Line 276  public class RenderingExecutor { Line 277  public class RenderingExecutor {
277                  public void run() {                  public void run() {
278                      pollTaskResult();                      pollTaskResult();
279                  }                  }
280              }, DEFAULT_POLLING_INTERVAL, DEFAULT_POLLING_INTERVAL, TimeUnit.MILLISECONDS);              }, pollingInterval, pollingInterval, TimeUnit.MILLISECONDS);
281    
282              return true;              return true;
283          }          }
# Line 323  public class RenderingExecutor { Line 324  public class RenderingExecutor {
324              case FAILED:              case FAILED:
325                  mapPane.onRenderingFailed(renderingException);                  mapPane.onRenderingFailed(renderingException);
326                  break;                  break;
327                    
328                case PENDING:
329                    mapPane.onRenderingPending();
330                    break;
331                    
332          }          }
333      }      }
334    

Legend:
Removed from v.510  
changed lines
  Added in v.513

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26