edu.duke.cs.banjo.application
Class BanjoThreadHandler

java.lang.Object
  extended byedu.duke.cs.banjo.application.BanjoThreadHandler

public class BanjoThreadHandler
extends java.lang.Object

Used for searching in a multi-threaded scenario. (Code is based on the old Banjo class, although this class is now used within the wrapper class that handles the actual multi-threading)

Change History:
Created on Aug 10, 2007

Author:
Jurgen Sladeczek (hjs)
For the latest info, please visit www.cs.duke.edu.

Field Summary
protected  int maxThreads
           
protected  PostProcessor postProcessor
           
protected  PreProcessor preProcessor
           
protected  SearcherI searcher
           
protected  Settings settings
           
protected  java.lang.String[] storedArgs
           
protected  int threadIndex
           
 
Constructor Summary
BanjoThreadHandler(java.lang.String[] _args, int _threadIndex, Settings _settings)
          Simple access point to the Banjo application.
 
Method Summary
 Settings getSettings()
           
protected  void handleFeedbackForProblems()
          Generates feedback in case the main search loop encountered a problem.
 void runSearch()
          Sets up, then initiates the execution of the Banjo application.
private  boolean validateRequiredData()
          Validates the settings values required for getting the main Banjo class started.
 java.lang.Object validChoices()
          Provides the valid choices for this class, here: the available searchers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

settings

protected volatile Settings settings

storedArgs

protected volatile java.lang.String[] storedArgs

threadIndex

protected volatile int threadIndex

searcher

protected volatile SearcherI searcher

preProcessor

protected volatile PreProcessor preProcessor

postProcessor

protected volatile PostProcessor postProcessor

maxThreads

protected int maxThreads
Constructor Detail

BanjoThreadHandler

public BanjoThreadHandler(java.lang.String[] _args,
                          int _threadIndex,
                          Settings _settings)
                   throws java.lang.Exception
Simple access point to the Banjo application.

Parameters:
_args - The (optional) arguments for running a search.
Method Detail

runSearch

public void runSearch()
Sets up, then initiates the execution of the Banjo application.


validateRequiredData

private boolean validateRequiredData()
                              throws java.lang.Exception
Validates the settings values required for getting the main Banjo class started.

Returns:
Returns the boolean flag that indicates whether a crucial setting could not be validated.
Throws:
java.lang.Exception

validChoices

public java.lang.Object validChoices()
Provides the valid choices for this class, here: the available searchers.


handleFeedbackForProblems

protected void handleFeedbackForProblems()
                                  throws java.lang.Exception
Generates feedback in case the main search loop encountered a problem.

Throws:
java.lang.Exception

getSettings

public Settings getSettings()
Returns:
Returns the settings.