Class AbstractPool

  • All Implemented Interfaces:
    Pool
    Direct Known Subclasses:
    NonBlockingPool

    public abstract class AbstractPool
    extends Object
    implements Pool

    Abstract pool provides the basic implementation of an object pool. The implementation uses a linked list to maintain a list of (available) objects. If the pool is empty it simply creates one using the ObjectFactory instance. Subclasses can change this behaviour by overriding getObject(...) and returnObject(....) methods. This class provides basic support for synchronization, event notification, pool shutdown and pool object recycling. It also does some very basic bookkeeping like the number of objects created, number of threads waiting for object.

    Subclasses can make use of these book-keeping data to provide complex pooling mechanism like LRU / MRU / Random. Also, note that AbstractPool does not have a notion of pool limit. It is upto to the derived classes to implement these features.

    • Field Detail

      • _logger

        protected static final Logger _logger
      • waitCount

        protected int waitCount
      • createdCount

        protected int createdCount
      • steadyPoolSize

        protected int steadyPoolSize
      • resizeQuantity

        protected int resizeQuantity
      • maxPoolSize

        protected int maxPoolSize
      • maxWaitTimeInMillis

        protected long maxWaitTimeInMillis
      • idleTimeoutInSeconds

        protected int idleTimeoutInSeconds
      • containerClassLoader

        protected ClassLoader containerClassLoader
      • destroyedCount

        protected int destroyedCount
      • poolSuccess

        protected int poolSuccess
      • poolName

        protected String poolName
      • poolReturned

        protected int poolReturned
      • configData

        protected String configData
      • appName

        protected String appName
      • modName

        protected String modName
      • ejbName

        protected String ejbName
      • beanId

        protected long beanId
    • Constructor Detail

      • AbstractPool

        public AbstractPool()
    • Method Detail

      • setContainerClassLoader

        public void setContainerClassLoader​(ClassLoader loader)
      • removeIdleObjects

        protected abstract void removeIdleObjects()
      • close

        public abstract void close()
      • getCreatedCount

        public int getCreatedCount()
      • getDestroyedCount

        public int getDestroyedCount()
      • getPoolSuccess

        public int getPoolSuccess()
      • getSize

        public int getSize()
      • getWaitCount

        public int getWaitCount()
      • getSteadyPoolSize

        public int getSteadyPoolSize()
      • getResizeQuantity

        public int getResizeQuantity()
      • getMaxPoolSize

        public int getMaxPoolSize()
      • getMaxWaitTimeInMillis

        public long getMaxWaitTimeInMillis()
      • getIdleTimeoutInSeconds

        public int getIdleTimeoutInSeconds()
      • setConfigData

        public void setConfigData​(String configData)
      • getJmsMaxMessagesLoad

        public int getJmsMaxMessagesLoad()
      • getNumBeansInPool

        public int getNumBeansInPool()
      • getNumThreadsWaiting

        public int getNumThreadsWaiting()
      • getTotalBeansCreated

        public int getTotalBeansCreated()
      • getTotalBeansDestroyed

        public int getTotalBeansDestroyed()
      • getAllMonitoredAttrbuteValues

        public String getAllMonitoredAttrbuteValues()
      • getAllAttrValues

        public String getAllAttrValues()
      • unregisterProbeProvider

        protected void unregisterProbeProvider()