edu.ucsb.adl.middleware.rmi
Class QueryThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--edu.ucsb.adl.middleware.rmi.QueryThread
All Implemented Interfaces:
QueryThread, java.lang.Runnable

public final class QueryThread
extends java.lang.Thread
implements QueryThread

A thread that submits an XML query to a remote middleware server.

Version:
$Header: /export/home/gjanee/middleware/edu/ucsb/adl/middleware/rmi/RCS/QueryThread.java,v 1.2 2003/06/10 16:42:44 gjanee Exp $

$Log: QueryThread.java,v $ Revision 1.2 2003/06/10 16:42:44 gjanee
Query results are now Result objects, i.e., triplets of standard metadata views.

Revision 1.1 2001/03/19 22:28:44 gjanee
Initial revision

Author:
Greg Janée
Alexandria Digital Library

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
QueryThread(edu.ucsb.adl.middleware.rmi.QueryDriver driver, edu.ucsb.adl.middleware.rmi.QueryService remoteQueryService, edu.ucsb.adl.middleware.rmi.CancelService remoteCancelService, edu.ucsb.adl.middleware.rmi.ResultsService remoteResultsService, java.lang.String query, long cycleTime, java.lang.String remoteCollectionName, java.lang.String localCollectionName, edu.ucsb.adl.middleware.ResultAccumulator accumulator)
          Creates a QueryThread.
 
Method Summary
 java.lang.String getCollection()
          Returns the name of the collection on whose behalf the thread is running.
 void run()
           
 void stopASAP()
          Requests that the thread stop as soon as possible.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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
 
Methods inherited from interface edu.ucsb.adl.middleware.QueryThread
start
 

Constructor Detail

QueryThread

public QueryThread(edu.ucsb.adl.middleware.rmi.QueryDriver driver,
                   edu.ucsb.adl.middleware.rmi.QueryService remoteQueryService,
                   edu.ucsb.adl.middleware.rmi.CancelService remoteCancelService,
                   edu.ucsb.adl.middleware.rmi.ResultsService remoteResultsService,
                   java.lang.String query,
                   long cycleTime,
                   java.lang.String remoteCollectionName,
                   java.lang.String localCollectionName,
                   edu.ucsb.adl.middleware.ResultAccumulator accumulator)
Creates a QueryThread.

Parameters:
driver - The query driver creating the thread.
remoteQueryService - The remote query service.
remoteCancelService - The remote cancel service.
remoteResultsService - The remote results service.
query - The XML query to submit.
cycleTime - How often the thread should poll the result set in milliseconds.
remoteCollectionName - The name of the remote collection, e.g., "adl_catalog".
localCollectionName - The local name for the collection.
accumulator - The accumulator to which results are to be sent.
Throws:
java.lang.NullPointerException - If any argument other than cycleTime is null.
java.lang.IllegalArgumentException - If cycleTime is negative.
Method Detail

stopASAP

public void stopASAP()
Requests that the thread stop as soon as possible.

Specified by:
stopASAP in interface QueryThread

getCollection

public java.lang.String getCollection()
Returns the name of the collection on whose behalf the thread is running.

Specified by:
getCollection in interface QueryThread
Returns:
The collection name, e.g., "adl_catalog".

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread