org.apache.jackrabbit.core.query.lucene
Class TextExtractorJob

java.lang.Object
  extended by EDU.oswego.cs.dl.util.concurrent.FutureResult
      extended by org.apache.jackrabbit.core.query.lucene.TextExtractorJob
All Implemented Interfaces:
Runnable

public class TextExtractorJob
extends EDU.oswego.cs.dl.util.concurrent.FutureResult
implements Runnable

TextExtractorJob implements a future result and is runnable in a background thread.


Field Summary
 
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.FutureResult
exception_, ready_, value_
 
Constructor Summary
TextExtractorJob(TextExtractor extractor, InputStream stream, String type, String encoding)
          Creates a new TextExtractorJob with the given extractor on the stream.
 
Method Summary
 Reader getReader(long timeout)
          Returns the reader with the extracted text from the input stream passed to the constructor of this TextExtractorJob.
 void run()
          Runs the actual text extraction.
 String toString()
           
 
Methods inherited from class EDU.oswego.cs.dl.util.concurrent.FutureResult
clear, doGet, get, getException, isReady, peek, set, setException, setter, timedGet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextExtractorJob

public TextExtractorJob(TextExtractor extractor,
                        InputStream stream,
                        String type,
                        String encoding)
Creates a new TextExtractorJob with the given extractor on the stream.

Parameters:
extractor - the text extractor
stream - the stream of the binary property.
type - the mime-type of the binary content.
encoding - the encoding of the binary content. May be null.
Method Detail

getReader

public Reader getReader(long timeout)
Returns the reader with the extracted text from the input stream passed to the constructor of this TextExtractorJob. The caller of this method is responsible for closing the returned reader. Returns null if a timeoutoccurs while waiting for the text extractor to get the reader.

Returns:
the Reader with the extracted text. Returns null if a timeout or an exception occured extracting the text.

toString

public String toString()
Overrides:
toString in class Object
Returns:
a String description for this job with the mime type.

run

public void run()
Runs the actual text extraction.

Specified by:
run in interface Runnable


Copyright © 2004-2007 The Apache Software Foundation. All Rights Reserved.