Class Pool


  • public class Pool
    extends java.lang.Object
    A simple pool implementation.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  Pool.Factory  
    • Constructor Summary

      Constructors 
      Constructor Description
      Pool​(int initialPoolSize, int maxPoolSize, Pool.Factory factory)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object fetchFromPool()  
      protected void putInPool​(java.lang.Object object)  
      private java.lang.Object readResolve()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • initialPoolSize

        private final int initialPoolSize
      • maxPoolSize

        private final int maxPoolSize
      • pool

        private transient java.lang.Object[] pool
      • nextAvailable

        private transient int nextAvailable
      • mutex

        private transient java.lang.Object mutex
    • Constructor Detail

      • Pool

        public Pool​(int initialPoolSize,
                    int maxPoolSize,
                    Pool.Factory factory)
    • Method Detail

      • fetchFromPool

        public java.lang.Object fetchFromPool()
      • putInPool

        protected void putInPool​(java.lang.Object object)
      • readResolve

        private java.lang.Object readResolve()