Package com.sas.iom.orb
Class ExecutorServiceThreadPool
java.lang.Object
com.sas.iom.orb.ThreadPool
com.sas.iom.orb.ExecutorServiceThreadPool
public class ExecutorServiceThreadPool
extends ThreadPool
ThreadPool implementation that wraps an ExecutorService.
-
Constructor Summary
ConstructorsConstructorDescriptionExecutorServiceThreadPool(java.util.concurrent.ExecutorService executor) Construct an ExecutorServiceThreadPool. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecuteDaemon(WorkInterface work) Execute a unit of work on an idle thread in the pool.voidterm()Release resources associated with the pool.Methods inherited from class com.sas.iom.orb.ThreadPool
addListener, executeStandard, finalize, removeListenerMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ExecutorServiceThreadPool
public ExecutorServiceThreadPool(java.util.concurrent.ExecutorService executor) Construct an ExecutorServiceThreadPool.- Parameters:
executor- the executor service to wrap
-
-
Method Details
-
executeDaemon
public void executeDaemon(WorkInterface work) throws WorkException Execute a unit of work on an idle thread in the pool. If all threads in the pool are busy, a new thread will be created.- Overrides:
executeDaemonin classThreadPool- Throws:
WorkException- if the pool refuses to execute the work
-
term
public void term()Release resources associated with the pool. Previously submitted work will be completed, but no new work will be accepted.- Overrides:
termin classThreadPool
-