ubc.cs.JLog.Foundation
Class jAPIConsultThread

java.lang.Object
  extended by java.lang.Thread
      extended by ubc.cs.JLog.Foundation.jPrologServiceThread
          extended by ubc.cs.JLog.Foundation.jAPIConsultThread
All Implemented Interfaces:
java.lang.Runnable

public class jAPIConsultThread
extends jPrologServiceThread

This class implements consulting of a prolog source text, throwing exceptions for encountered errors.

Author:
Glendon Holst

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  jPrologServiceBroadcaster begin
           
protected  jPrologServiceBroadcaster end
           
protected  java.lang.RuntimeException result_exception
           
protected  java.lang.String source
           
 
Fields inherited from class ubc.cs.JLog.Foundation.jPrologServiceThread
allow_release, prolog, stopped
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
jAPIConsultThread(jPrologServices ps, java.lang.String src)
           
 
Method Summary
 java.lang.RuntimeException getResultException()
          Returns the RuntimeException thrown by an unsucessful query / retry (e.g., UnknownPredicateException).
 boolean isCurrentlyConsulting()
           
 void run()
          Performs and controls the entire consultation phase.
 void setListeners(jPrologServiceBroadcaster b, jPrologServiceBroadcaster e, jPrologServiceBroadcaster s)
           
 
Methods inherited from class ubc.cs.JLog.Foundation.jPrologServiceThread
broadcasted_stop, getPrologServices, printOutput, setAllowRelease, setStoppedListeners
 
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

source

protected java.lang.String source

begin

protected jPrologServiceBroadcaster begin

end

protected jPrologServiceBroadcaster end

result_exception

protected java.lang.RuntimeException result_exception
Constructor Detail

jAPIConsultThread

public jAPIConsultThread(jPrologServices ps,
                         java.lang.String src)
Method Detail

setListeners

public void setListeners(jPrologServiceBroadcaster b,
                         jPrologServiceBroadcaster e,
                         jPrologServiceBroadcaster s)

run

public void run()
Performs and controls the entire consultation phase.

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

isCurrentlyConsulting

public boolean isCurrentlyConsulting()
Overrides:
isCurrentlyConsulting in class jPrologServiceThread

getResultException

public java.lang.RuntimeException getResultException()
Returns the RuntimeException thrown by an unsucessful query / retry (e.g., UnknownPredicateException).

Returns:
Returns a RuntimeException if the query failed. Returns null if the query did not throw an exception.