nl.toolforge.karma.core.vc.threads
Class RunnerThread

java.lang.Object
  extended byjava.lang.Thread
      extended bynl.toolforge.karma.core.vc.threads.RunnerThread
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
CVSLogThread, PatchLineThread

public abstract class RunnerThread
extends java.lang.Thread

Version:
$Id: RunnerThread.java,v 1.6 2004/11/10 23:53:09 asmedes Exp $
Author:
D.A. Smedes

Field Summary
protected  java.lang.Throwable exception
           
protected  RunnerResult result
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RunnerThread(Module module)
           
 
Method Summary
 java.lang.Throwable getException()
           
 Module getModule()
          Returns the module status, irrespective of whether this thread has finished executing or not.
 RunnerResult getResult()
           
 boolean isRunning()
          Should be checked to ensure that run() is finished.
abstract  void run()
          Must be implemented by subclasses.
protected  void startRunning()
          Should be called to demarkate the start of the 'transaction'.
protected  void stopRunning()
          Should be called to demarkate the end of the 'transaction'.
 
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
 

Field Detail

exception

protected java.lang.Throwable exception

result

protected RunnerResult result
Constructor Detail

RunnerThread

public RunnerThread(Module module)
Method Detail

run

public abstract void run()
Must be implemented by subclasses. The subclass is where all logic is performed.


startRunning

protected void startRunning()
Should be called to demarkate the start of the 'transaction'.


stopRunning

protected void stopRunning()
Should be called to demarkate the end of the 'transaction'.


isRunning

public final boolean isRunning()
Should be checked to ensure that run() is finished.

Returns:

getResult

public final RunnerResult getResult()

getModule

public Module getModule()
Returns the module status, irrespective of whether this thread has finished executing or not. This check can be performed by calling isRunning().

Returns:
The ModuleStatus instance generated based on what the run() has done when executed properly.

getException

public java.lang.Throwable getException()


Copyright © 2002-2004 Toolforge. All Rights Reserved.