com.sas.iom.orb
Class ExecutorServiceThreadPool

com.sas.iom.orb.ExecutorServiceThreadPool

public class ExecutorServiceThreadPool

ThreadPool implementation that wraps an ExecutorService.


Constructor Summary
ExecutorServiceThreadPool(java.util.concurrent.ExecutorService executor)
          Construct an ExecutorServiceThreadPool.
 
Method Summary
 void executeDaemon(com.sas.iom.orb.WorkInterface work)
          Execute a unit of work on an idle thread in the pool.
 void term()
          Release resources associated with the pool.
 

Constructor Detail

ExecutorServiceThreadPool

public ExecutorServiceThreadPool(java.util.concurrent.ExecutorService executor)
Construct an ExecutorServiceThreadPool.

Parameters:
executor - the executor service to wrap
Method Detail

executeDaemon

public void executeDaemon(com.sas.iom.orb.WorkInterface work)
                   throws com.sas.iom.orb.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:
executeDaemon in class com.sas.iom.orb.ThreadPool
Throws:
com.sas.iom.orb.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:
term in class com.sas.iom.orb.ThreadPool



Copyright © 2009 SAS Institute Inc. All Rights Reserved.