Management interface for client connections . More...
The following notice applies to the original API on which this API is based, and to its documentation. The documentation of this API has been revised from the original.
/* * Copyright (C) 2006 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
Public Member Functions | |
SchemeRegistry | getSchemeRegistry () |
Obtains the scheme registry used by this manager. More... | |
ClientConnectionRequest | requestConnection (HttpRoute route, Object state) |
Returns a new com.good.gd.apache.http.conn.ClientConnectionRequest, from which a com.good.gd.apache.http.conn.ManagedClientConnection can be obtained or the request can be aborted. | |
void | releaseConnection (ManagedClientConnection conn, long validDuration, TimeUnit timeUnit) |
Releases a connection for use by others. More... | |
void | closeIdleConnections (long idletime, TimeUnit tunit) |
Closes idle connections in the pool. More... | |
void | closeExpiredConnections () |
Closes all expired connections in the pool. More... | |
void | shutdown () |
Shuts down this connection manager and releases allocated resources. More... | |
SchemeRegistry getSchemeRegistry | ( | ) |
null
Implemented in ThreadSafeClientConnManager, and SingleClientConnManager.
void releaseConnection | ( | ManagedClientConnection | conn, |
long | validDuration, | ||
TimeUnit | timeUnit | ||
) |
You may optionally specify how long the connection is valid to be reused. Values <= 0 are considered to be valid forever. If the connection is not marked as reusable, the connection will not be reused regardless of the valid duration.
If the connection has been released before, the call will be ignored.
conn | the connection to release |
validDuration | the duration of time this connection is valid for reuse |
timeUnit | the unit of time validDuration is measured in |
Implemented in SingleClientConnManager, and ThreadSafeClientConnManager.
void closeIdleConnections | ( | long | idletime, |
TimeUnit | tunit | ||
) |
Open connections in the pool that have not been used for the timespan given by the argument will be closed. Currently allocated connections are not subject to this method. Times will be checked with milliseconds precision
All expired connections will also be closed.
idletime | the idle time of connections to be closed |
tunit | the unit for the idletime |
Implemented in ThreadSafeClientConnManager, and SingleClientConnManager.
void closeExpiredConnections | ( | ) |
Open connections in the pool that have not been used for the timespan defined when the connection was released will be closed. Currently allocated connections are not subject to this method. Times will be checked with milliseconds precision.
Implemented in SingleClientConnManager, and ThreadSafeClientConnManager.
void shutdown | ( | ) |
This includes closing all connections, whether they are currently used or not.
Implemented in SingleClientConnManager, and ThreadSafeClientConnManager.