jason.core.pool
Class ThreadPoolImpl
java.lang.Object
|
+--jason.core.pool.ThreadPoolImpl
- All Implemented Interfaces:
- ThreadPool
- public class ThreadPoolImpl
- extends java.lang.Object
- implements ThreadPool
This program is an generic implementation of thread pool engine, which takes the following input
a) Size of the pool to be constructed
b) Name of the class which implements Runnable (which has a visible default constructor)
and constructs a thread pool with active threads that are waiting for activation.
once the threads have finished processing they come back and wait once again in the pool.
This thread pool engine can be locked i.e. if some internal operation is performed on the pool
then it is preferable that the thread engine be locked. Locking ensures that no new threads are issued
by the engine. However, the currently executing threads are allowed to continue till they come back
to the passivePool.
Method Summary |
ThreadCapsule |
getThreadCapsule()
This method returns a ThreadCapsule object with the client processing thread embedded in it
If the method doesn't found a threadcapsulse it return null
|
protected void |
initializePools(int totalPoolSize)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThreadPoolImpl
public ThreadPoolImpl(int totalPoolSize)
initializePools
protected void initializePools(int totalPoolSize)
getThreadCapsule
public ThreadCapsule getThreadCapsule()
- This method returns a ThreadCapsule object with the client processing thread embedded in it
If the method doesn't found a threadcapsulse it return
null
- Specified by:
getThreadCapsule
in interface ThreadPool