uPortal 2.4.1
API Documentation

org.jasig.portal.utils.threading
Class BoundedThreadPool

java.lang.Object
  extended byorg.jasig.portal.utils.threading.AbstractPool
      extended byorg.jasig.portal.utils.threading.BoundedThreadPool
All Implemented Interfaces:
ThreadPool
Direct Known Subclasses:
UnboundedThreadPool

public class BoundedThreadPool
extends AbstractPool

A thread pool with a maxium number of possible worker threads

Version:
$Revision: 1.5 $
Author:
Constructor Summary
BoundedThreadPool(int minThreads, int maxThreads, int threadPriority)
          BoundedThreadPool Construcutor
 
Method Summary
 void destroyThread(java.lang.Thread thread)
          Destroyed a pooled thread
 WorkTracker execute(WorkerTask task)
          Queues up a task to be executed.
 
Methods inherited from class org.jasig.portal.utils.threading.AbstractPool
busyThreads, destroy, getPooledThread, idleThreads, lockThread, releaseThread, totalThreads
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoundedThreadPool

public BoundedThreadPool(int minThreads,
                         int maxThreads,
                         int threadPriority)
BoundedThreadPool Construcutor

Parameters:
minThreads - the min number of worker threads that can be in this pool
maxThreads - the max number of worker threads that can be in this pool
threadPriority - the priority these worker threads should have
Method Detail

destroyThread

public void destroyThread(java.lang.Thread thread)
Destroyed a pooled thread

Specified by:
destroyThread in interface ThreadPool
Specified by:
destroyThread in class AbstractPool
Parameters:
thread - the thread to be destroyed

execute

public WorkTracker execute(WorkerTask task)
                    throws java.lang.IllegalStateException
Queues up a task to be executed. The queue use FIFO ordering.

Specified by:
execute in interface ThreadPool
Specified by:
execute in class AbstractPool
Parameters:
task - the task to be executed
Returns:
the WorkerTracker for used to track and interact with this task
Throws:
java.lang.IllegalStateException - - thrown if the pool has been destroyed

uPortal 2.4.1
API Documentation