|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.kosi.util.ThreadPool
The class ThreadPool implements a thread pool. A thread pool is used to prevent the server from creating to many threads, which will hit the performance. Instead a constant number of threads is created. When a task is to be executed asynchronous, a thread is requested and the task is executed. If there is currently no thread available, the task is delayed until a thread becomes available.
ChangeLog:
$Log: ThreadPool.java,v $ Revision 1.5 2001/06/27 19:09:18 jiriki Resolved minor bugs. Updated docs. Revision 1.4 2001/06/12 17:14:33 jiriki - Reimplemented DistributedList to make filters working - Made ServertestCase working. Revision 1.3 2001/05/22 20:24:40 jiriki Made source more conformant to Coding Conventions. ThreadPool.java,v Revision 1.12 2001/04/09 15:36:19 wombat Improved UserImpl, removed bugs Revision 1.11 2001/04/09 13:03:10 wombat Removed timeout from threadpool (did not work) Revision 1.10 2001/03/21 13:26:36 wombat - Removed bugs in Table - began implementation of stree client - updated documentation Revision 1.9 2001/03/20 16:01:59 wombat Introduced persistant tasks Revision 1.8 2001/03/18 17:32:04 wombat Changed database concept Revision 1.7 2001/02/25 23:16:05 wombat - deadlock vermeidung umgestellt. - ListenerList erstellt Revision 1.6 2001/02/06 14:29:09 wombat Updated documentation Revision 1.5 2001/02/06 11:32:50 wombat started ssl implementation Revision 1.4 2001/02/04 17:12:59 wombat - updated Documentation - continued implementation of UserManger Revision 1.3 2001/01/31 11:28:12 wombat Updated Documentation.
Method Summary | |
void |
close()
Close the ThreadPool. |
WaitObject |
executeAsync(java.util.List tasks)
Executes a list of tasks asynchronous. |
WaitObject |
executeAsync(java.lang.Runnable task)
Executes a task asynchronous. |
void |
executeFutureTask(long time,
java.lang.Runnable task)
Executes a task in the future. |
static ThreadPool |
getThreadPool()
Returns the singleton instance of the ThreadPool. |
int |
getThreadPoolThreads()
Return the number of threads in the thread pool |
void |
setThreadPoolThreads(int threads)
Set the number of threads in the thread pool. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public WaitObject executeAsync(java.util.List tasks)
tasks
- list of tasks to be executed.waitForCalls
method of the
WaitObject returns, when all tasks have ended.public WaitObject executeAsync(java.lang.Runnable task)
task
- task to be executed.public void executeFutureTask(long time, java.lang.Runnable task)
time
- time (in millis) until the task should be started.task
- task to be executed.public static ThreadPool getThreadPool()
public int getThreadPoolThreads()
public void setThreadPoolThreads(int threads)
threads
- Number of threads.public void close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |