ObjectPool.borrowObject

Obtains an instance from this pool. <p> Instances returned from this method will have been either newly created with {@link PooledObjectFactory#makeObject} or will be a previously idle object and have been activated with {@link PooledObjectFactory#activateObject} and then validated with {@link PooledObjectFactory#validateObject}. </p> <p> By contract, clients <strong>must</strong> return the borrowed instance using {@link #returnObject}, {@link #invalidateObject}, or a related method as defined in an implementation or sub-interface. </p> <p> The behaviour of this method when the pool has been exhausted is not strictly specified (although it may be specified by implementations). </p>

@return an instance from this pool.

@throws IllegalStateException after {@link #close close} has been called on this pool. @throws Exception when {@link PooledObjectFactory#makeObject} throws an exception. @throws NoSuchElementException when the pool is exhausted and cannot or will not return another instance.

interface ObjectPool(T)
T
borrowObject
()

Meta