예제 #1
0
  private void outputMessage(String msg, int msgType) {
    if (isInterrupted()) {
      return;
    }

    if (m_msgHandler != null) {
      m_msgHandler.outputMessage(msg + "\n", msgType);
    } else {
      try {
        m_outWriter.write(msg);
        m_outWriter.newLine();
      } catch (Exception ex) {
        System.err.println(msg);
      }
    }
  }
예제 #2
0
 public void run() {
   try {
     setConfig(ConfigManager.getCurrentConfig());
     if (m_outWriter == null && m_msgHandler == null) {
       useLocalWriter = true;
     } else {
       useLocalWriter = false;
     }
     if (useLocalWriter) {
       openOutputFile();
     }
     checkRules();
     if (useLocalWriter) {
       closeOutputFile();
     }
   } finally {
     if (m_msgHandler != null) {
       m_msgHandler.close();
     }
   }
 }