| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.http.impl.conn.SingleClientConnManager
BasicClientConnectionManager
@Contract(threading=SAFE) @Deprecated public class SingleClientConnManager
A connection manager for a single connection. This connection manager maintains only one active connection at a time. Even though this class is thread-safe it ought to be used by one execution thread only.
 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.
| Nested Class Summary | |
|---|---|
| protected  class | SingleClientConnManager.ConnAdapterDeprecated. The connection adapter used by this manager. | 
| protected  class | SingleClientConnManager.PoolEntryDeprecated. The pool entry for this connection manager. | 
| Field Summary | |
|---|---|
| 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 Summary | |
|---|---|
| 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. | |
| Method Summary | |
|---|---|
| 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. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
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
| Constructor Detail | 
|---|
@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()
| Method Detail | 
|---|
protected void finalize()
                 throws Throwable
finalize in class ObjectThrowablepublic SchemeRegistry getSchemeRegistry()
ClientConnectionManager
getSchemeRegistry in interface ClientConnectionManagernullprotected ClientConnectionOperator createConnectionOperator(SchemeRegistry schreg)
DefaultClientConnectionOperator.
schreg - the scheme registry to use, or null
protected final void assertStillUp()
                            throws IllegalStateException
IllegalStateException - if this manager is shut down
public final ClientConnectionRequest requestConnection(HttpRoute route,
                                                       Object state)
ClientConnectionManagerClientConnectionRequest, from which a
 ManagedClientConnection can be obtained or the request can be
 aborted.
requestConnection in interface ClientConnectionManager
public ManagedClientConnection getConnection(HttpRoute route,
                                             Object state)
route - where the connection should point to
public void releaseConnection(ManagedClientConnection conn,
                              long validDuration,
                              TimeUnit timeUnit)
ClientConnectionManager
releaseConnection 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()
ClientConnectionManager
closeExpiredConnections in interface ClientConnectionManager
public void closeIdleConnections(long idletime,
                                 TimeUnit timeUnit)
ClientConnectionManager
closeIdleConnections in interface ClientConnectionManageridletime - the idle time of connections to be closedtimeUnit - the unit for the idletimeClientConnectionManager.closeExpiredConnections()public void shutdown()
ClientConnectionManager
shutdown in interface ClientConnectionManagerprotected void revokeConnection()
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||