de.netseeker.ejoe.concurrent
Class ThreadPool

java.lang.Object
  extended byde.netseeker.ejoe.concurrent.ThreadPool
All Implemented Interfaces:
java.lang.Runnable

public final class ThreadPool
extends java.lang.Object
implements java.lang.Runnable

Since:
0.3.0
Author:
netseeker aka Michael Manske

Constructor Summary
ThreadPool()
           
ThreadPool(int numberOfThreads)
           
ThreadPool(int numberOfThreads, int threadPriority)
           
ThreadPool(java.lang.ThreadGroup threadGroup)
           
ThreadPool(java.lang.ThreadGroup threadGroup, int numberOfThreads)
           
 
Method Summary
 int getRunnableCount()
          Returns number of runnable object in the queue.
 void invokeLater(java.lang.Runnable task)
          Dispatch a new task onto this pool to be invoked asynchronously later
 void run()
          The method ran by the pool of background threads
 void setThreadGroup(java.lang.ThreadGroup threadGroup)
           
 java.lang.Thread startThread()
          Start a new thread running
 java.lang.Thread startThread(int priority)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadPool

public ThreadPool(int numberOfThreads,
                  int threadPriority)
Parameters:
numberOfThreads -
threadPriority -

ThreadPool

public ThreadPool(int numberOfThreads)
Parameters:
numberOfThreads -

ThreadPool

public ThreadPool()

ThreadPool

public ThreadPool(java.lang.ThreadGroup threadGroup)
Parameters:
threadGroup -

ThreadPool

public ThreadPool(java.lang.ThreadGroup threadGroup,
                  int numberOfThreads)
Parameters:
threadGroup -
numberOfThreads -
Method Detail

setThreadGroup

public void setThreadGroup(java.lang.ThreadGroup threadGroup)
Parameters:
threadGroup -

startThread

public java.lang.Thread startThread()
Start a new thread running


startThread

public java.lang.Thread startThread(int priority)
Parameters:
priority -
Returns:

stop

public void stop()

getRunnableCount

public int getRunnableCount()
Returns number of runnable object in the queue.


invokeLater

public void invokeLater(java.lang.Runnable task)
Dispatch a new task onto this pool to be invoked asynchronously later


run

public void run()
The method ran by the pool of background threads

Specified by:
run in interface java.lang.Runnable


Copyright © 2005-2006 netseeker. All Rights Reserved.