BasicClientConnectionManager@Contract(threading=SAFE) @Deprecated public class SingleClientConnManager extends Object implements ClientConnectionManager
 SingleClientConnManager will make an effort to reuse the connection
 for subsequent requests with the same route.
 It will, however, close the existing connection and open it
 for the given route, if the route of the persistent connection does
 not match that of the connection request. If the connection has been
 already been allocated IllegalStateException is thrown.
| Modifier and Type | Class and Description | 
|---|---|
| protected class  | SingleClientConnManager.ConnAdapterDeprecated.  The connection adapter used by this manager. | 
| protected class  | SingleClientConnManager.PoolEntryDeprecated.  The pool entry for this connection manager. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected boolean | alwaysShutDownDeprecated.  Whether the connection should be shut down  on release. | 
| protected long | connectionExpiresTimeDeprecated.  The time the last released connection expires and shouldn't be reused. | 
| protected ClientConnectionOperator | connOperatorDeprecated.  The operator for opening and updating connections. | 
| protected boolean | isShutDownDeprecated.  Indicates whether this connection manager is shut down. | 
| protected long | lastReleaseTimeDeprecated.  The time of the last connection release, or -1. | 
| protected SingleClientConnManager.ConnAdapter | managedConnDeprecated.  The currently issued managed connection, if any. | 
| static String | MISUSE_MESSAGEDeprecated.  The message to be logged on multiple allocation. | 
| protected SchemeRegistry | schemeRegistryDeprecated.  The schemes supported by this connection manager. | 
| protected SingleClientConnManager.PoolEntry | uniquePoolEntryDeprecated.  The one and only entry in this pool. | 
| Constructor and Description | 
|---|
| SingleClientConnManager()Deprecated.  | 
| SingleClientConnManager(org.apache.http.params.HttpParams params,
                       SchemeRegistry schreg)Deprecated. 
 (4.1)  use  SingleClientConnManager(SchemeRegistry) | 
| SingleClientConnManager(SchemeRegistry schreg)Deprecated.  Creates a new simple connection manager. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected void | assertStillUp()Deprecated.  Asserts that this manager is not shut down. | 
| void | closeExpiredConnections()Deprecated.  Closes all expired connections in the pool. | 
| void | closeIdleConnections(long idletime,
                    TimeUnit timeUnit)Deprecated.  Closes idle connections in the pool. | 
| protected ClientConnectionOperator | createConnectionOperator(SchemeRegistry schreg)Deprecated.  Hook for creating the connection operator. | 
| protected void | finalize()Deprecated.  | 
| ManagedClientConnection | getConnection(HttpRoute route,
             Object state)Deprecated.  Obtains a connection. | 
| SchemeRegistry | getSchemeRegistry()Deprecated.  Obtains the scheme registry used by this manager. | 
| void | releaseConnection(ManagedClientConnection conn,
                 long validDuration,
                 TimeUnit timeUnit)Deprecated.  Releases a connection for use by others. | 
| ClientConnectionRequest | requestConnection(HttpRoute route,
                 Object state)Deprecated.  Returns a new  ClientConnectionRequest, from which aManagedClientConnectioncan be obtained or the request can be
 aborted. | 
| protected void | revokeConnection()Deprecated.  | 
| void | shutdown()Deprecated.  Shuts down this connection manager and releases allocated resources. | 
public static final String MISUSE_MESSAGE
protected final SchemeRegistry schemeRegistry
protected final ClientConnectionOperator connOperator
protected final boolean alwaysShutDown
protected volatile SingleClientConnManager.PoolEntry uniquePoolEntry
protected volatile SingleClientConnManager.ConnAdapter managedConn
protected volatile long lastReleaseTime
protected volatile long connectionExpiresTime
protected volatile boolean isShutDown
@Deprecated public SingleClientConnManager(org.apache.http.params.HttpParams params, SchemeRegistry schreg)
SingleClientConnManager(SchemeRegistry)params - the parameters for this managerschreg - the scheme registrypublic SingleClientConnManager(SchemeRegistry schreg)
schreg - the scheme registrypublic SingleClientConnManager()
protected void finalize()
                 throws Throwable
public SchemeRegistry getSchemeRegistry()
ClientConnectionManagergetSchemeRegistry in interface ClientConnectionManagernullprotected ClientConnectionOperator createConnectionOperator(SchemeRegistry schreg)
DefaultClientConnectionOperator.schreg - the scheme registry to use, or nullprotected final void assertStillUp()
                            throws IllegalStateException
IllegalStateException - if this manager is shut downpublic final ClientConnectionRequest requestConnection(HttpRoute route, Object state)
ClientConnectionManagerClientConnectionRequest, from which a
 ManagedClientConnection can be obtained or the request can be
 aborted.requestConnection in interface ClientConnectionManagerpublic ManagedClientConnection getConnection(HttpRoute route, Object state)
route - where the connection should point topublic void releaseConnection(ManagedClientConnection conn, long validDuration, TimeUnit timeUnit)
ClientConnectionManagerreleaseConnection in interface ClientConnectionManagerconn - the connection to releasevalidDuration - the duration of time this connection is valid for reusetimeUnit - the unit of time validDuration is measured inClientConnectionManager.closeExpiredConnections()public void closeExpiredConnections()
ClientConnectionManagercloseExpiredConnections in interface ClientConnectionManagerpublic void closeIdleConnections(long idletime,
                        TimeUnit timeUnit)
ClientConnectionManagercloseIdleConnections in interface ClientConnectionManageridletime - the idle time of connections to be closedtimeUnit - the unit for the idletimeClientConnectionManager.closeExpiredConnections()public void shutdown()
ClientConnectionManagershutdown in interface ClientConnectionManagerprotected void revokeConnection()
Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.