KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jsmtpd > generic > threadpool > ThreadPool


1 package org.jsmtpd.generic.threadpool;
2
3 public interface ThreadPool {
4
5     /**
6      * Will gracefully shutdown each running thread
7      *
8      */

9     public abstract void gracefullShutdown();
10
11     /**
12      * Will force each thread to shutdown
13      *
14      */

15     public abstract void forceShutdown();
16
17     /**
18      *
19      * @return true if any free thread
20      */

21     public abstract boolean hasFreeThread();
22
23     /**
24      *
25      */

26     public abstract int countFreeThread();
27
28     /**
29      * passes the obj parameter to the thread instance, and runs its doJob mehtod
30      * @param obj the object to pass
31      * @throws BusyThreadPoolException when the pool is exhausted
32      */

33     public abstract void assignFreeThread(Object JavaDoc obj) throws BusyThreadPoolException;
34
35 }
Popular Tags