Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.k_int.hss
Class HSSSearchTask  view HSSSearchTask download HSSSearchTask.java

java.lang.Object
  extended byjava.util.Observable
      extended bycom.k_int.IR.SearchTask
          extended bycom.k_int.hss.HSSSearchTask

public class HSSSearchTask
extends com.k_int.IR.SearchTask

HSSSearchTask Object used in conunction with HeterogeneousSetOfSearchable object to track the progress of a specific HSS query and provide access to it's results (And component searches)

Version:
$Id: HSSSearchTask.java,v 1.22 2002/12/11 10:25:32 ianibbo Exp $

Field Summary
private  AggregateFragmentSource afs
           
private static LoggingContext cat
           
static int dbg_counter
           
private  HeterogeneousSetOfSearchable manager
           
private static java.lang.String[] private_status_types
           
private  int status
           
 java.util.Observer subtask_observer
           
private  java.util.Hashtable subtasks
           
private  int tasks_outstanding
           
private  ThreadPool thread_pool
           
 
Fields inherited from class com.k_int.IR.SearchTask
create_time, max_messages, message_log, query, requestedSyntax, requestedSyntaxName, TASK_COMPLETE, TASK_EXECUTING, TASK_FAILURE, task_identifier, TASK_IDLE, TASK_MESSAGE_DIAGNOSTIC, TASK_MESSAGE_ERROR, TASK_MESSAGE_INFO, TASK_MESSAGE_WARNING, task_status_code, TASK_UNDEFINED, user_data
 
Fields inherited from class java.util.Observable
 
Constructor Summary
HSSSearchTask(HeterogeneousSetOfSearchable manager, java.util.Observer[] observers)
           
 
Method Summary
 void addSubQuery(com.k_int.IR.SearchTask st)
           
 void beginSearchGroup()
          Used to indicate that a client is sending a group of queries to search and that the search should not be considered complete until after the last task has been established.
 void cancelTask()
          Cancel any active operation, but leave all the searchTask's data intact
 void destroyTask()
          Shut down the task and release any resources, maybe notify our creating searchable.
 void endSearchGroup()
          Used to indicate that a client has done adding child queries and we can now wait for all sub tasks to complete...
 int evaluate(int timeout)
          Evaluate the query, waiting at most timeout milliseconds, returning the search status.
protected  void finalize()
          Called on an object by the Virtual Machine at most once, at some point after the Object is determined unreachable but before it is destroyed.
 int getPrivateTaskStatusCode()
           
 com.k_int.IR.InformationFragmentSource getTaskResultSet()
          getTaskResultSet.
 java.lang.String lookupPrivateStatusCode(int code)
           
 
Methods inherited from class com.k_int.IR.SearchTask
addDiagnosticObserver, addFragmentSourceObserver, broadcastStatusMessage, getLastStatusMessages, getQuery, getRequestedSyntax, getRequestedSyntaxName, getSubtasks, getTaskCreationTime, getTaskIdentifier, getTaskStatusCode, getUserData, hasSubtasks, logStatusMessage, setDiagnosticStatus, setMaxStatusMessageItems, setQuery, setRequestedSyntax, setRequestedSyntaxName, setTaskStatusCode, setUserData, waitForCondition, waitForStatus
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

private_status_types

private static java.lang.String[] private_status_types

status

private int status

manager

private HeterogeneousSetOfSearchable manager

subtasks

private java.util.Hashtable subtasks

cat

private static LoggingContext cat

dbg_counter

public static int dbg_counter

thread_pool

private ThreadPool thread_pool

afs

private AggregateFragmentSource afs

tasks_outstanding

private int tasks_outstanding

subtask_observer

public java.util.Observer subtask_observer
Constructor Detail

HSSSearchTask

public HSSSearchTask(HeterogeneousSetOfSearchable manager,
                     java.util.Observer[] observers)
Method Detail

finalize

protected void finalize()
Description copied from class: java.lang.Object
Called on an object by the Virtual Machine at most once, at some point after the Object is determined unreachable but before it is destroyed. You would think that this means it eventually is called on every Object, but this is not necessarily the case. If execution terminates abnormally, garbage collection does not always happen. Thus you cannot rely on this method to always work. For finer control over garbage collection, use references from the java.lang.ref package.

Virtual Machines are free to not call this method if they can determine that it does nothing important; for example, if your class extends Object and overrides finalize to do simply super.finalize().

finalize() will be called by a java.lang.Thread that has no locks on any Objects, and may be called concurrently. There are no guarantees on the order in which multiple objects are finalized. This means that finalize() is usually unsuited for performing actions that must be thread-safe, and that your implementation must be use defensive programming if it is to always work.

If an Exception is thrown from finalize() during garbage collection, it will be patently ignored and the Object will still be destroyed.

It is allowed, although not typical, for user code to call finalize() directly. User invocation does not affect whether automatic invocation will occur. It is also permitted, although not recommended, for a finalize() method to "revive" an object by making it reachable from normal code again.

Unlike constructors, finalize() does not get called for an object's superclass unless the implementation specifically calls super.finalize().

The default implementation does nothing.


getPrivateTaskStatusCode

public int getPrivateTaskStatusCode()

lookupPrivateStatusCode

public java.lang.String lookupPrivateStatusCode(int code)

addSubQuery

public void addSubQuery(com.k_int.IR.SearchTask st)

evaluate

public int evaluate(int timeout)
             throws com.k_int.IR.TimeoutExceededException
Description copied from class: com.k_int.IR.SearchTask
Evaluate the query, waiting at most timeout milliseconds, returning the search status. InformationFragmentSource object should be used to check the final number of result records.


getTaskResultSet

public com.k_int.IR.InformationFragmentSource getTaskResultSet()
Description copied from class: com.k_int.IR.SearchTask
getTaskResultSet. Search tasks delagate the responsibility of managing a result set to an instance of the InformationFragmentSource. Often, the SearchTask will implement InformationFragmentSource itself, and return (this) as the realisation of the getTaskResultSet method. Other SearchTasks may use some cache managing FragmentSource to wrapper the source result set and return that object. This method returns a producer object that is used by consumers such as the result set enumeration to list all the records found by a search task.


beginSearchGroup

public void beginSearchGroup()
Used to indicate that a client is sending a group of queries to search and that the search should not be considered complete until after the last task has been established.


endSearchGroup

public void endSearchGroup()
Used to indicate that a client has done adding child queries and we can now wait for all sub tasks to complete...


cancelTask

public void cancelTask()
Description copied from class: com.k_int.IR.SearchTask
Cancel any active operation, but leave all the searchTask's data intact


destroyTask

public void destroyTask()
Description copied from class: com.k_int.IR.SearchTask
Shut down the task and release any resources, maybe notify our creating searchable. It is essential that this method be called on the object.