View Javadoc
1   package org.kuali.ole.batch.marc;
2   
3   import org.marc4j.*;
4   import org.xml.sax.InputSource;
5   
6   /**
7    * Created with IntelliJ IDEA.
8    * User: meenrajd
9    * Date: 9/2/13
10   * Time: 11:56 AM
11   * To change this template use File | Settings | File Templates.
12   */
13  public class OLEMarcXmlParserThread extends Thread {
14  
15      private RecordStack queue;
16      private InputSource input;
17      private ErrorHandler errors;
18  
19      public OLEMarcXmlParserThread(RecordStack queue, InputSource input, ErrorHandler errors) {
20          this.queue = queue;
21          this.input = input;
22          this.errors = errors;
23      }
24  
25      public void run() {
26          try {
27              MarcXmlHandler handler = new OLEMarcXmlHandler(queue, errors);
28              MarcXmlParser parser = new MarcXmlParser(handler);
29              parser.parse(input);
30          } catch (MarcException me) {
31              queue.passException(me);
32          } finally {
33              queue.end();
34          }
35      }
36  
37  }