org.apache.lokahi.core.controller
Class CheckJvmThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.apache.lokahi.core.controller.CheckJvmThread
All Implemented Interfaces:
java.lang.Runnable

public class CheckJvmThread
extends java.lang.Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static java.lang.String contentMatch
           
static org.apache.log4j.Logger logger
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CheckJvmThread()
          private constructor.
 
Method Summary
static void doPrimaryFunction()
           
protected  void finalize()
          This method is called when the context shuts down.
 java.lang.String getContentMatch()
           
static CheckJvmThread getThreadInstance(java.lang.String val)
          Returns a handle to the main thread.
static java.lang.String isTheThreadRunning(java.lang.String test)
          This method returns the value of the variable 'runThread'
static void iterateJobPools(State s)
           
 void run()
          This method determines whether or not to run the designated process(e.g.
 boolean runTheThread()
          This method returns the value of the variable 'runThread'
static void startThread()
          This method sets the value of the variable 'runThread' to true.
static void stopThread()
          This method sets the value of the variable 'runThread' to false
 
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, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

public static final org.apache.log4j.Logger logger

contentMatch

public static final java.lang.String contentMatch
Constructor Detail

CheckJvmThread

public CheckJvmThread()
private constructor. Instantiates the classes and variables used by this thread

Method Detail

getThreadInstance

public static CheckJvmThread getThreadInstance(java.lang.String val)
Returns a handle to the main thread. sets the jvmHttp value to the value passed


finalize

protected void finalize()
                 throws java.lang.Throwable
This method is called when the context shuts down. We should perform all the cleanup operations related to the thread here.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

runTheThread

public boolean runTheThread()
This method returns the value of the variable 'runThread'


isTheThreadRunning

public static java.lang.String isTheThreadRunning(java.lang.String test)
This method returns the value of the variable 'runThread'


getContentMatch

public java.lang.String getContentMatch()

startThread

public static void startThread()
This method sets the value of the variable 'runThread' to true. The calling servlet/jsp MUST call the start() method of this class after calling startThread(). The reason start() (actually run..) cannot be called from here is because startThread() is a static method and run() is not.


stopThread

public static void stopThread()
This method sets the value of the variable 'runThread' to false


run

public void run()
This method determines whether or not to run the designated process(e.g. thread) based on whether thread is primary or backup or alternate.

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

iterateJobPools

public static void iterateJobPools(State s)

doPrimaryFunction

public static void doPrimaryFunction()