gov.sandia.ccaffeine.dc.user_iface.MVC
Class ThreadWaitForResultSet

java.lang.Object
  extended by java.lang.Thread
      extended by gov.sandia.ccaffeine.dc.user_iface.MVC.ThreadWaitForResultSet
All Implemented Interfaces:
java.lang.Runnable

public class ThreadWaitForResultSet
extends java.lang.Thread

We sent a query and/or a command to the cca server. Wait for that cca server to respond. The cca server will either send us the result set or send us an exception.

We have two possible scenarios. In the first scenario, this thread is started BEFORE the cca server sends back a result set in response to the query. In the second scenario, this thread is started AFTER the cca server sends back a result set.

SCENARIO:
this thread is started
this thread waits for the ResultSetEvent to arrive
cca server processes query and sends ResultSetEvent
This thread terminates

SCENARIO:
cca server processes query and sends ResultSetEvent
this thread is started
this thread immediately terminates


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  java.lang.Exception exception
           
protected  java.lang.String resultSet
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ThreadWaitForResultSet()
           
 
Method Summary
 java.lang.Exception getException()
          Retrieve the exception.
 java.lang.String getResultSet()
          Retrieve the result set that the cca server sent.
 void receivedException(java.lang.Exception exception)
          An error occurred.
 void receivedResultSet(java.lang.String resultSet)
          The cca server is returning a result set.
 void run()
          Wait for a result set or an exception or a time out
 void start()
          Start 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, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

resultSet

protected java.lang.String resultSet

exception

protected java.lang.Exception exception
Constructor Detail

ThreadWaitForResultSet

public ThreadWaitForResultSet()
Method Detail

getResultSet

public java.lang.String getResultSet()
Retrieve the result set that the cca server sent. If an error occurs then return null.

Returns:
The result set from the cca server. If an error occurs then the result set is null.

getException

public java.lang.Exception getException()
Retrieve the exception. A null value means that no errors occcurred.

Returns:
The exception. A null value is returned if no errors occurred.

start

public void start()
Start the thread.

Overrides:
start in class java.lang.Thread

run

public void run()
Wait for a result set or an exception or a time out

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

receivedResultSet

public void receivedResultSet(java.lang.String resultSet)
The cca server is returning a result set.

Parameters:
returnValue - The value that the cca server is sending to us.

receivedException

public void receivedException(java.lang.Exception exception)
An error occurred. The cca server can not send us a result set.

Parameters:
exception - The exception that the cca server is sending us.