Class SimpleObjectPool<T extends BasePooledObject>

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public final class SimpleObjectPool<T extends BasePooledObject>
    extends java.lang.Object
    implements java.io.Closeable
    • Constructor Detail

      • SimpleObjectPool

        public SimpleObjectPool​(PooledObjectFactory<T> objectFactory,
                                int poolSize,
                                int maxWaitTime,
                                int maxLifeTime,
                                int maxIdleTime)
    • Method Detail

      • execute

        public void execute​(PooledObjectConsumer<T> consumer)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • borrowObject

        public T borrowObject()
                       throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • returnObject

        public void returnObject​(T pooledObject)
      • invalidateObject

        public void invalidateObject​(T pooledObject)
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable