/** * Any successful pop() call requires a corresponding push() or discard() call * <p/> * A pop() call that returns null is considered successful. * * @param timeout time to block while waiting for an instance * @param unit unit of time dicated by the timeout * @return an entry from the pool or null indicating permission to create and push() an instance into the pool * @throws InterruptedException vm level thread interruption * @throws IllegalStateException if a permit could not be acquired * @throws TimeoutException if no instance could be obtained within the timeout */ public Entry pop(final long timeout, final TimeUnit unit) throws InterruptedException, TimeoutException { return pop(timeout, unit, true); }
/** * Any successful pop() call requires a corresponding push() or discard() call * <p/> * A pop() call that returns null is considered successful. * * @param timeout time to block while waiting for an instance * @param unit unit of time dicated by the timeout * @return an entry from the pool or null indicating permission to create and push() an instance into the pool * @throws InterruptedException vm level thread interruption * @throws IllegalStateException if a permit could not be acquired * @throws TimeoutException if no instance could be obtained within the timeout */ public Entry pop(final long timeout, final TimeUnit unit) throws InterruptedException, TimeoutException { return pop(timeout, unit, true); }
public Pool<Instance>.Entry poolPop() throws InterruptedException, TimeoutException { return pool.pop(accessTimeout.getTime(), accessTimeout.getUnit()); }
public Pool.Entry<Instance> poolPop() throws InterruptedException, TimeoutException { return pool.pop(accessTimeout.getTime(), accessTimeout.getUnit()); }
public Pool<Instance>.Entry poolPop() throws InterruptedException, TimeoutException { return pool.pop(accessTimeout.getTime(), accessTimeout.getUnit()); }
public Pool<Instance>.Entry poolPop() throws InterruptedException, TimeoutException { return pool.pop(accessTimeout.getTime(), accessTimeout.getUnit()); }
entries.add(pool.pop(1, TimeUnit.SECONDS)); snooze();