01: package org.jsmtpd.generic.threadpool;
02:
03: public interface ThreadPool {
04:
05: /**
06: * Will gracefully shutdown each running thread
07: *
08: */
09: 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 obj)
34: throws BusyThreadPoolException;
35:
36: }
|