ParkNPark.tests
Class FaultInjector

java.lang.Object
  extended by java.lang.Thread
      extended by ParkNPark.tests.FaultInjector
All Implemented Interfaces:
Runnable

public class FaultInjector
extends Thread

Fault injector background thread that injects random faults into the servers. This fault injector presently implements the following faults:


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  boolean exit
          Our thread exit flag
protected  int faultInjectionMaxDelay
          The maximum delay of the fault injection in milliseconds
protected  int faultInjectionMinDelay
          The minimum delay of the fault injection in milliseconds
protected  NameService nameService
          Instance of our common name service management object
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FaultInjector(NameService nameService, int faultInjectionMinDelay, int faultInjectionMaxDelay)
          Creates a new fault injector using the given NameService helper object
 
Method Summary
 void beginExit()
          Tells this thread to begin its graceful shutdown
 void run()
          Runs the fault injector
 
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

nameService

protected NameService nameService
Instance of our common name service management object


exit

protected boolean exit
Our thread exit flag


faultInjectionMinDelay

protected int faultInjectionMinDelay
The minimum delay of the fault injection in milliseconds


faultInjectionMaxDelay

protected int faultInjectionMaxDelay
The maximum delay of the fault injection in milliseconds

Constructor Detail

FaultInjector

public FaultInjector(NameService nameService,
                     int faultInjectionMinDelay,
                     int faultInjectionMaxDelay)
Creates a new fault injector using the given NameService helper object

Parameters:
nameService - The NameService helper object to query the running servers from
faultInjectionMinDelay - The minimum delay of the fault injector in milliseconds
faultInjectionMinDelay - The maximum delay of the fault injector in milliseconds
Method Detail

beginExit

public void beginExit()
Tells this thread to begin its graceful shutdown


run

public void run()
Runs the fault injector

Specified by:
run in interface Runnable
Overrides:
run in class Thread