Code example for ScheduledThreadPoolExecutor

Methods: schedule

0
    * @param task this is the task to schedule for execution 
    * @param delay this is the delay to wait before execution 
    * @param unit this is the duration time unit to wait for 
    */    
   public void execute(Runnable task, long delay, TimeUnit unit) {
      executor.schedule(task, delay, unit);
   } 
    
   /** 
    * This is used to stop the executor by interrupting all running 
    * tasks and shutting down the threads within the pool. This will 
    * return once it has been stopped, and no further tasks will be  
    * accepted by this pool for execution. 
    */    
   public void stop() { 
      stop(60000); 
   } 
    
   /** 
    * This is used to stop the executor by interrupting all running