info.ephyra.answerselection.filters
Class WebDocumentFetcher

java.lang.Object
  extended by java.lang.Thread
      extended by info.ephyra.answerselection.filters.WebDocumentFetcher
All Implemented Interfaces:
java.lang.Runnable

 class WebDocumentFetcher
extends java.lang.Thread

A thread that fetches a web document containing a given search engine snippet.

This class extends the class Thread.

Version:
2007-05-15
Author:
Nico Schlaefer

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  WebDocumentFetcherFilter filter
          The WebDocumentFetcherFilter that started this thread.
private static int RETRIES
          Number of retries if the HTTP connection fails.
private  Result snippet
          The search engine snippet.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
WebDocumentFetcher()
           
 
Method Summary
 void run()
          Fetches the document text and returns it to the WebDocumentFetcherFilter.
 void start(WebDocumentFetcherFilter filter, Result snippet)
          Sets the calling filter and the snippet and starts the thread.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RETRIES

private static final int RETRIES
Number of retries if the HTTP connection fails.

See Also:
Constant Field Values

filter

private WebDocumentFetcherFilter filter
The WebDocumentFetcherFilter that started this thread.


snippet

private Result snippet
The search engine snippet.

Constructor Detail

WebDocumentFetcher

WebDocumentFetcher()
Method Detail

start

public void start(WebDocumentFetcherFilter filter,
                  Result snippet)
Sets the calling filter and the snippet and starts the thread.

Parameters:
filter - the calling WebDocumentFetcherFilter
snippet - search engine snippet

run

public void run()
Fetches the document text and returns it to the WebDocumentFetcherFilter.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread