public void acceptTrainingSet(final TrainingSetEvent e) {
    
    if (e.isStructureOnly()) {
      // no need to build a classifier, instead just generate a dummy
      // BatchClassifierEvent in order to pass on instance structure to
      // any listeners - eg. PredictionAppender can use it to determine
      // the final structure of instances with predictions appended
      BatchClassifierEvent ce = 
        new BatchClassifierEvent(this, m_Classifier, 
                                 new DataSetEvent(this, e.getTrainingSet()),
                                 new DataSetEvent(this, e.getTrainingSet()),
                                 e.getSetNumber(), e.getMaxSetNumber());

      notifyBatchClassifierListeners(ce);
      return;
    }
    
    if (m_reject) {
      //block(true);
      if (m_log != null) {
        m_log.statusMessage(statusMessagePrefix() + "BUSY. Can't accept data "
            + "at this time.");
        m_log.logMessage("[Classifier] " + statusMessagePrefix()
            + " BUSY. Can't accept data at this time.");
      }
      return;
    }
    
    // Do some initialization if this is the first set of the first run
    if (e.getRunNumber() == 1 && e.getSetNumber() == 1) {
//      m_oldText = m_visual.getText();
      // store the training header
      m_trainingSet = new Instances(e.getTrainingSet(), 0);
      m_state = BUILDING_MODEL;
      
      String msg = "[Classifier] " + statusMessagePrefix() 
        + " starting executor pool ("
        + getExecutionSlots() + " slots)...";
      if (m_log != null) {
        m_log.logMessage(msg);
      } else {
        System.err.println(msg);
      }
      // start the execution pool
      if (m_executorPool == null) {
        startExecutorPool();
      }
            
      // setup output queues
      msg = "[Classifier] " + statusMessagePrefix() + " setup output queues.";
      if (m_log != null) {
        m_log.logMessage(msg);
      } else {
        System.err.println(msg);
      }
      
      m_outputQueues = 
        new BatchClassifierEvent[e.getMaxRunNumber()][e.getMaxSetNumber()];
    }
    
    // create a new task and schedule for execution
    TrainingTask newTask = new TrainingTask(e.getRunNumber(), e.getMaxRunNumber(),
        e.getSetNumber(), e.getMaxSetNumber(), e.getTrainingSet());
    String msg = "[Classifier] " + statusMessagePrefix() + " scheduling run " 
    + e.getRunNumber() +" fold " + e.getSetNumber() + " for execution...";
    if (m_log != null) {
      m_log.logMessage(msg);
    } else {
      System.err.println(msg);
    }
    
    // delay just a little bit
    /*try {
      Thread.sleep(10);
    } catch (Exception ex){} */
    m_executorPool.execute(newTask);
  }