org.enhydra.shark.client.utilities
Class LimitChecker

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.enhydra.shark.client.utilities.LimitChecker
All Implemented Interfaces:
java.lang.Runnable

public class LimitChecker
extends java.lang.Thread

Checks limits on running processes, and aborts ones which riched that limit.

Author:
Sasa Bojanic

Field Summary
protected  long delay
           
protected  int failuresToIgnore
           
protected  int instancesPerTransaction
           
protected  java.util.List limitStructs
           
protected  boolean stopped
           
protected  java.lang.String username
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LimitChecker(java.lang.String username, java.util.List limitStructs, long delay, int instPerTrans, int failToIgnore)
           
 
Method Summary
protected  void checkLimits(java.util.List instancesToCheck)
           
protected  boolean checkLimitStructs()
           
 void run()
           
protected  void runMe()
           
 void setDelay(long delay)
           
 void setFailuresToIgnore(int failToIgnore)
           
 void setInstancesPerTransaction(int insPerTrans)
           
 void setLimitStructs(java.util.List ls)
           
 void startChecker()
           
 void stopChecker()
           
protected  void updateLimitStructs()
           
 
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

username

protected java.lang.String username

delay

protected long delay

instancesPerTransaction

protected int instancesPerTransaction

failuresToIgnore

protected int failuresToIgnore

stopped

protected boolean stopped

limitStructs

protected java.util.List limitStructs
Constructor Detail

LimitChecker

public LimitChecker(java.lang.String username,
                    java.util.List limitStructs,
                    long delay,
                    int instPerTrans,
                    int failToIgnore)
Method Detail

setDelay

public void setDelay(long delay)

setLimitStructs

public void setLimitStructs(java.util.List ls)

setInstancesPerTransaction

public void setInstancesPerTransaction(int insPerTrans)

setFailuresToIgnore

public void setFailuresToIgnore(int failToIgnore)

stopChecker

public void stopChecker()

startChecker

public void startChecker()

run

public void run()

runMe

protected void runMe()

checkLimits

protected void checkLimits(java.util.List instancesToCheck)
                    throws java.lang.Exception
Throws:
java.lang.Exception

checkLimitStructs

protected boolean checkLimitStructs()
                             throws java.lang.Exception
Throws:
java.lang.Exception

updateLimitStructs

protected void updateLimitStructs()