public void addDownloadTask(TmmTask task){
  if (downloadExecutor == null) {
    downloadExecutor=new ThreadPoolExecutor(1,1,1,TimeUnit.SECONDS,new LinkedBlockingQueue<Runnable>(),new TmmThreadFactory("download-task"));
    downloadExecutor.allowCoreThreadTimeOut(true);
  }
  task.addListener(this);
  task.setState(TaskState.QUEUED);
  downloadExecutor.execute(task);
}

public void addDownloadTask ( TmmTask task ) { if ( downloadExecutor == null ) { downloadExecutor = new ThreadPoolExecutor ( 1 , 1 , 1 , TimeUnit . SECONDS , new LinkedBlockingQueue < Runnable > ( ) , new TmmThreadFactory ( "download-task" ) ) ; downloadExecutor . allowCoreThreadTimeOut ( true ) ; } task . addListener ( this ) ; task . setState ( TaskState . QUEUED ) ; downloadExecutor . execute ( task ) ; }
add a download task to the queue
