spec.harness
Class ProgramRunner

java.lang.Object
  extended by java.lang.Thread
      extended by spec.harness.ProgramRunner
All Implemented Interfaces:
java.lang.Runnable

public class ProgramRunner
extends java.lang.Thread

This class is derived from java.lang.Thread. The benchmark is started in a seperate thread. The benchmark implements a method harnessMain(). The run method of the Programmer runner calls the harnessMain() of the class that it dynamically creates, given its name.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 BenchmarkResult bmResult
          The test result
 BenchmarkThread[] bmts
          The tenchmark threads.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ProgramRunner(BenchmarkResult result, int mode)
          Overloaded constructor for the class.
 
Method Summary
static void endOfMeasurementInterval(long iterEndTime)
           
static int getNoBmHarnessThreads(BenchmarkResult bmResult)
           
static java.lang.String getStackTraceAsString(java.lang.Throwable t)
           
static void interruptProgramRunner()
           
 void run()
          The overloaded run method for the BenchmarkRunner.
static void setPrintProgress(boolean printProgress)
           
 
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

bmResult

public BenchmarkResult bmResult
The test result


bmts

public BenchmarkThread[] bmts
The tenchmark threads.

Constructor Detail

ProgramRunner

public ProgramRunner(BenchmarkResult result,
                     int mode)
Overloaded constructor for the class.

Parameters:
result - The Benchmark result where all results are stored. This also includes configuration for the run.
Method Detail

setPrintProgress

public static void setPrintProgress(boolean printProgress)

run

public void run()
The overloaded run method for the BenchmarkRunner. This method just set the thread priority and calls the runBenchmark method

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

getStackTraceAsString

public static java.lang.String getStackTraceAsString(java.lang.Throwable t)

getNoBmHarnessThreads

public static int getNoBmHarnessThreads(BenchmarkResult bmResult)

interruptProgramRunner

public static void interruptProgramRunner()

endOfMeasurementInterval

public static void endOfMeasurementInterval(long iterEndTime)