mk.fsgrep.util.thread
Class ThreadPool

java.lang.Object
  extended by mk.fsgrep.util.thread.ThreadPool
All Implemented Interfaces:
RunCallback

public class ThreadPool
extends java.lang.Object
implements RunCallback

Author:
Murali Krishnan

Constructor Summary
ThreadPool(java.lang.String pName, int pSize)
           
 
Method Summary
protected  int findNumberAvailable()
           
protected  java.util.LinkedList<ThreadRunner> getAvailable()
           
 java.lang.String getName()
           
protected  ThreadRunner getNextAvailable()
           
 int getSize()
           
 void initialize()
           
protected  ThreadRunner removeFirst()
           
 void run(java.lang.Runnable runnable)
           
 void runFinished(ThreadRunner runner)
           
 java.lang.String toString()
           
 void waitForCompletion()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThreadPool

public ThreadPool(java.lang.String pName,
                  int pSize)
Method Detail

initialize

public void initialize()

getAvailable

protected java.util.LinkedList<ThreadRunner> getAvailable()

getName

public java.lang.String getName()

getSize

public int getSize()

removeFirst

protected ThreadRunner removeFirst()

getNextAvailable

protected ThreadRunner getNextAvailable()

findNumberAvailable

protected int findNumberAvailable()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

run

public void run(java.lang.Runnable runnable)

waitForCompletion

public void waitForCompletion()

runFinished

public void runFinished(ThreadRunner runner)
Specified by:
runFinished in interface RunCallback


Copyright © 2009. All Rights Reserved.