Framework Professional Edition Package


com.prosyst.util.threadpool
Interface ThreadPoolManager


public interface ThreadPoolManager

The ThreadPoolManager is responsible for the management of a thread pool, whose purpose is to provide created and started threads to clients, using multiple but short-lived threads. The ThreadPoolManager's main task is to accept Runnable objects, to pass them to threads from the pool, and after the job is finished - to return back the threads in pool.


Method Summary
 void execute(java.lang.Runnable job, int priority, java.lang.String threadName)
          Executes the job, by passing it to an idle thread process.
 void execute(java.lang.Runnable job, java.lang.String threadName)
          Executes the job, by passing it to an idle thread process.
 void reset()
          All idle threads exit.
 

Method Detail

execute

void execute(java.lang.Runnable job,
             java.lang.String threadName)
             throws java.lang.IllegalArgumentException
Executes the job, by passing it to an idle thread process. If no idle threads are available, the job is moved to the pool of waiting jobs, and will be executed later.

Parameters:
job - job to be executed
threadName - name of job; the name will be assigned to the thread, in which the job will be processed
Throws:
java.lang.IllegalArgumentException - If any of the arguments is null

execute

void execute(java.lang.Runnable job,
             int priority,
             java.lang.String threadName)
             throws java.lang.IllegalArgumentException
Executes the job, by passing it to an idle thread process. If no idle threads are available, the job is moved to the pool of waiting jobs, and will be executed later.

Parameters:
Runnable - job to be executed
int - the priority of the job
threadName - name of job; the name will be assigned to the thread, in which the job will be processed
Throws:
java.lang.IllegalArgumentException - If any of the arguments is null

reset

void reset()
All idle threads exit. New threads will be created when it is necessary.


Framework Professional Edition Package


Copyright © 1999-2007 ProSyst Software GmbH. All Rights Reserved