org.apache.manifoldcf.core.database
Class Database.ExecuteQueryThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.apache.manifoldcf.core.database.Database.ExecuteQueryThread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
Database

protected class Database.ExecuteQueryThread
extends java.lang.Thread

Thread used to execute queries. An instance of this thread is spun up every time a query is executed. This is necessary because JDBC does not guarantee interruptability, and the Postgresql JDBC driver unfortunately eats all thread interrupts. So, we fire up a thread to do each interaction with the database server, thus insuring that the owning thread remains interruptable and will therefore not block shutdown.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  boolean bResults
           
protected  java.sql.Connection connection
           
protected  java.lang.Throwable exception
           
protected  int maxResults
           
protected  java.util.ArrayList params
           
protected  java.lang.String query
           
protected  ILimitChecker returnLimit
           
protected  IResultSet rval
           
protected  ResultSpecification spec
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Database.ExecuteQueryThread(java.sql.Connection connection, java.lang.String query, java.util.ArrayList params, boolean bResults, int maxResults, ResultSpecification spec, ILimitChecker returnLimit)
           
 
Method Summary
 java.lang.Throwable getException()
           
 IResultSet getResponse()
           
 void run()
           
 
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

connection

protected java.sql.Connection connection

query

protected java.lang.String query

params

protected java.util.ArrayList params

bResults

protected boolean bResults

maxResults

protected int maxResults

spec

protected ResultSpecification spec

returnLimit

protected ILimitChecker returnLimit

exception

protected java.lang.Throwable exception

rval

protected IResultSet rval
Constructor Detail

Database.ExecuteQueryThread

public Database.ExecuteQueryThread(java.sql.Connection connection,
                                   java.lang.String query,
                                   java.util.ArrayList params,
                                   boolean bResults,
                                   int maxResults,
                                   ResultSpecification spec,
                                   ILimitChecker returnLimit)
Method Detail

run

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

getException

public java.lang.Throwable getException()

getResponse

public IResultSet getResponse()