1 17 18 19 20 package org.apache.lenya.lucene.html; 21 22 import java.io.IOException ; 23 24 25 class ParserThread extends Thread { 26 HTMLParser parser; 27 28 ParserThread(HTMLParser p) { 29 parser = p; 30 } 31 32 35 public void run() { 37 try { 38 try { parser.HTMLDocument(); 40 } catch (ParseException e) { 41 System.out.println("Parse Aborted: " + e.getMessage()); 42 } catch (TokenMgrError e) { 43 System.out.println("Parse Aborted: " + e.getMessage()); 44 } finally { 45 parser.pipeOut.close(); 46 47 synchronized (parser) { 48 parser.summary.setLength(HTMLParser.SUMMARY_LENGTH); 49 parser.titleComplete = true; 50 parser.notifyAll(); 51 } 52 } 53 } catch (IOException e) { 54 e.printStackTrace(); 55 } 56 } 57 } 58 | Popular Tags |