org.apache.avalon.excalibur.testcase
Class LatchedThreadGroup

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.avalon.excalibur.testcase.LatchedThreadGroup
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled

Deprecated. ECM is no longer supported

public class LatchedThreadGroup
extends org.apache.avalon.framework.logger.AbstractLogEnabled

This class is useful for writing MultiThreaded test cases where you need to perform multithreaded load testing on a component.

An instance of will create a block of threads of the specified size. Each thread will be assigned to run a specified Runnable instance. The threads will then all wait at a latch until the go method is called. The go method will not return until all of the Runnables have completed.

Version:
$Id: LatchedThreadGroup.java,v 1.4 2004/02/28 11:47:27 cziegeler Exp $
Author:
Avalon Development Team

Nested Class Summary
private  class LatchedThreadGroup.Runner
          Deprecated.  
 
Field Summary
private  int m_completedCount
          Deprecated.  
private  java.lang.Throwable m_exception
          Deprecated.  
private  boolean m_latched
          Deprecated.  
private  java.lang.Object m_semaphore
          Deprecated.  
private  int m_startedCount
          Deprecated.  
private  java.lang.Thread[] m_threads
          Deprecated.  
 
Constructor Summary
LatchedThreadGroup(java.lang.Runnable[] runnables)
          Deprecated. Creates a LatchedThreadGroup with a thread for each Runnable in the runnables array.
LatchedThreadGroup(java.lang.Runnable runnable, int threadCount)
          Deprecated. Creates a LatchedThreadGroup with threadCount threads each running runnable.
 
Method Summary
private  org.apache.avalon.framework.logger.Logger getInnerLogger()
          Deprecated. Inner access method to getLogger() to work around a bug in the Javac compiler when getLogger() is called from the method of an inner class.
 long go()
          Deprecated. Causes all of the Runnables to start at the same instance.
protected  void resetMemory()
          Deprecated.  
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_threads

private java.lang.Thread[] m_threads
Deprecated. 

m_semaphore

private java.lang.Object m_semaphore
Deprecated. 

m_startedCount

private int m_startedCount
Deprecated. 

m_latched

private boolean m_latched
Deprecated. 

m_completedCount

private int m_completedCount
Deprecated. 

m_exception

private java.lang.Throwable m_exception
Deprecated. 
Constructor Detail

LatchedThreadGroup

public LatchedThreadGroup(java.lang.Runnable[] runnables)
Deprecated. 
Creates a LatchedThreadGroup with a thread for each Runnable in the runnables array.


LatchedThreadGroup

public LatchedThreadGroup(java.lang.Runnable runnable,
                          int threadCount)
Deprecated. 
Creates a LatchedThreadGroup with threadCount threads each running runnable.

Method Detail

resetMemory

protected void resetMemory()
Deprecated. 

go

public long go()
        throws java.lang.Exception
Deprecated. 
Causes all of the Runnables to start at the same instance. This method will return once all of the Runnables have completed.

Returns:
time, in milliseconds, that it took for all of the Runnables to complete.
Throws:
java.lang.Exception

getInnerLogger

private org.apache.avalon.framework.logger.Logger getInnerLogger()
Deprecated. 
Inner access method to getLogger() to work around a bug in the Javac compiler when getLogger() is called from the method of an inner class. Jikes seems to handle it Ok. :-/