|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.core.service.Service | +--org.exolab.core.service.BasicService | +--org.exolab.jms.threads.ThreadPoolManager
The thread pool manager manages all the required ThreadPool
objects.
The clients can obtain a ThreadPool from the ThreadPoolManager
with
a given number of Threads.
The manager keeps a list of all The ThreadPools it has dished out with a unique client provided name. Client can then re-request the already created ThreadPool or share common ThreadPools if required.
The ThreadPool manager will attempt to shutdown all ThreadPools and stop all Threads when it receives a stop request.
If a client attempts to create a ThreadPool with a name that already exists a ThreadPoolExistsException will be raised and the creation will fail.
Method Summary | |
org.exolab.core.threadPool.ThreadPool |
createThreadPool(java.lang.String name,
int size)
A client has requested a new thread pool creation with the given name. |
void |
deleteThreadPool(java.lang.String name)
Attempts to shutdown all the threads in the pool and removes the given ThreadPool. |
org.exolab.core.threadPool.ThreadPool |
getThreadPool(java.lang.String name)
Get the ThreadPool with the given name. |
static ThreadPoolManager |
instance()
Return the one and only instance of the ThreadPoolManager. |
void |
run()
This starts the ThreadPoolManager's thread |
void |
stop()
Overide BasicService.stop. |
Methods inherited from class org.exolab.core.service.BasicService |
start, toString |
Methods inherited from class org.exolab.core.service.Service |
getName, getState, restart, setState |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public static ThreadPoolManager instance()
Note: Initiase must be called above to initialise the pool, else a null object will be returned.
public org.exolab.core.threadPool.ThreadPool createThreadPool(java.lang.String name, int size) throws ThreadPoolExistsException
name
- The unique name given to this ThreadPoolsize
- The maximum nuber of Threads this pool contains.ThreadPoolExistsException
- if the pool with the given name
already exists.public org.exolab.core.threadPool.ThreadPool getThreadPool(java.lang.String name) throws UnknownThreadPoolException
name
- The unique name of the requested ThreadPoolUnknownThreadPoolException
- if the pool with the given name
does not exist.public void deleteThreadPool(java.lang.String name) throws UnknownThreadPoolException
name
- The unique name of the requested ThreadPoolUnknownThreadPoolException
- if the pool with the given name
does not exist.public void run()
run
in class org.exolab.core.service.BasicService
public void stop() throws org.exolab.core.service.ServiceException
stop
in class org.exolab.core.service.BasicService
org.exolab.core.service.ServiceException
-
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |