10571058105910601061106210631064106510661067
*/ @Override public void clear(final K key) throws Exception, UnsupportedOperationException { WriteLock writeLock = readWriteLock.writeLock(); writeLock.lock(); try { keyedPool.clear(key); } finally { writeLock.unlock(); }
10711072107310741075107610771078107910801081
* {@inheritDoc} */ @Override public void close() { WriteLock writeLock = readWriteLock.writeLock(); writeLock.lock(); try { keyedPool.close(); } catch (Exception e) { // swallowed as of Pool 2 } finally {
6869707172737475767778
} finally { readLock.unlock(); } try { writeLock.lock(); // Set the current settings for this socket wrapper.setBlockingStatus(block); if (block) { Socket.timeoutSet(socket, endpoint.getSoTimeout() * 1000); } else {
6061626364656667686970
readLock.unlock(); } if (!readDone) { try { writeLock.lock(); wrapper.setBlockingStatus(block); // Set the current settings for this socket Socket.optSet(socket, Socket.APR_SO_NONBLOCK, (block ? 0 : 1)); // Downgrade the lock try {
250251252253254255256257258259260
651652653654655656657658659660661
749750751752753754755756757758759
*/ @Override public T borrowObject() throws Exception, NoSuchElementException, IllegalStateException { WriteLock writeLock = readWriteLock.writeLock(); writeLock.lock(); try { return pool.borrowObject(); } finally { writeLock.unlock(); }
763764765766767768769770771772773
* {@inheritDoc} */ @Override public void returnObject(final T obj) { WriteLock writeLock = readWriteLock.writeLock(); writeLock.lock(); try { pool.returnObject(obj); } catch (Exception e) { // swallowed as of Pool 2 } finally {
779780781782783784785786787788789
* {@inheritDoc} */ @Override public void invalidateObject(final T obj) { WriteLock writeLock = readWriteLock.writeLock(); writeLock.lock(); try { pool.invalidateObject(obj); } catch (Exception e) { // swallowed as of Pool 2 } finally {
796797798799800801802803804805806
*/ @Override public void addObject() throws Exception, IllegalStateException, UnsupportedOperationException { WriteLock writeLock = readWriteLock.writeLock(); writeLock.lock(); try { pool.addObject(); } finally { writeLock.unlock(); }