org.apache.qpid.pool
Class ReferenceCountingExecutorService

java.lang.Object
  extended by org.apache.qpid.pool.ReferenceCountingExecutorService

public class ReferenceCountingExecutorService
extends java.lang.Object

We share the executor service among several PoolingFilters. This class reference counts how many filter chains are using the executor service and destroys the service, thus freeing up its threads, when the count reaches zero. It recreates the service when the count is incremented. This is particularly important on the client where failing to destroy the executor service prevents the JVM from shutting down due to the existence of non-daemon threads.


Method Summary
static ReferenceCountingExecutorService getInstance()
           
 java.util.concurrent.ExecutorService getPool()
          The filters that use the executor service should call this method to get access to the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ReferenceCountingExecutorService getInstance()

getPool

public java.util.concurrent.ExecutorService getPool()
The filters that use the executor service should call this method to get access to the service. Note that this method does not alter the reference count.

Returns:
the underlying executor service