Made #revokeConnection() synchronized and alwaysShutDown final

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@768009 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2009-04-23 18:49:21 +00:00
parent 5433ef9c77
commit 04fa90ceff
1 changed files with 6 additions and 5 deletions

View File

@ -72,14 +72,17 @@ public class SingleClientConnManager implements ClientConnectionManager {
"Invalid use of SingleClientConnManager: connection still allocated.\n" + "Invalid use of SingleClientConnManager: connection still allocated.\n" +
"Make sure to release the connection before allocating another one."; "Make sure to release the connection before allocating another one.";
/** The schemes supported by this connection manager. */ /** The schemes supported by this connection manager. */
protected final SchemeRegistry schemeRegistry; protected final SchemeRegistry schemeRegistry;
/** The operator for opening and updating connections. */ /** The operator for opening and updating connections. */
protected final ClientConnectionOperator connOperator; protected final ClientConnectionOperator connOperator;
/** Whether the connection should be shut down on release. */
protected final boolean alwaysShutDown;
/** The one and only entry in this pool. */ /** The one and only entry in this pool. */
@GuardedBy("this")
protected PoolEntry uniquePoolEntry; protected PoolEntry uniquePoolEntry;
/** The currently issued managed connection, if any. */ /** The currently issued managed connection, if any. */
@ -87,15 +90,13 @@ public class SingleClientConnManager implements ClientConnectionManager {
protected ConnAdapter managedConn; protected ConnAdapter managedConn;
/** The time of the last connection release, or -1. */ /** The time of the last connection release, or -1. */
@GuardedBy("this")
protected long lastReleaseTime; protected long lastReleaseTime;
/** The time the last released connection expires and shouldn't be reused. */ /** The time the last released connection expires and shouldn't be reused. */
@GuardedBy("this") @GuardedBy("this")
protected long connectionExpiresTime; protected long connectionExpiresTime;
/** Whether the connection should be shut down on release. */
protected boolean alwaysShutDown;
/** Indicates whether this connection manager is shut down. */ /** Indicates whether this connection manager is shut down. */
protected volatile boolean isShutDown; protected volatile boolean isShutDown;
@ -342,7 +343,7 @@ public class SingleClientConnManager implements ClientConnectionManager {
* @deprecated no longer used * @deprecated no longer used
*/ */
@Deprecated @Deprecated
protected void revokeConnection() { protected synchronized void revokeConnection() {
if (managedConn == null) if (managedConn == null)
return; return;
managedConn.detach(); managedConn.detach();