Package org.sblim.wbem.http
Class HttpClientPool
- java.lang.Object
-
- org.sblim.wbem.http.HttpClientPool
-
public class HttpClientPool extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description HttpClientPool()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closePool(boolean pKeepActive)
protected void
finalize()
int
getNumberOfAllConnections()
Returns the number of connections in this pool that are available/free for (re-)use.int
getNumberOfAvailableConnections()
Returns the number of all connections in this pool.int
getPoolSize()
Returns poolSizeSessionProperties
getSessionProperties()
boolean
removeConnectionFromPool(HttpClient httpClient)
Removes a connection completly from the pool.HttpClient
retrieveAvailableConnectionFromPool(java.net.URI pUri, AuthorizationHandler pHandler)
Returns the available connections of this pool for a given URI&AuthorizationHandlerboolean
returnAvailableConnectionToPool(HttpClient httpClient)
Add the connection to the pool.void
setSessionProperties(SessionProperties pSessionProperties)
-
-
-
Method Detail
-
getNumberOfAllConnections
public int getNumberOfAllConnections()
Returns the number of connections in this pool that are available/free for (re-)use.- Returns:
- number of available/free connections in pool
-
getNumberOfAvailableConnections
public int getNumberOfAvailableConnections()
Returns the number of all connections in this pool.- Returns:
- number of all connections in pool
-
getSessionProperties
public SessionProperties getSessionProperties()
-
setSessionProperties
public void setSessionProperties(SessionProperties pSessionProperties)
-
retrieveAvailableConnectionFromPool
public HttpClient retrieveAvailableConnectionFromPool(java.net.URI pUri, AuthorizationHandler pHandler)
Returns the available connections of this pool for a given URI&AuthorizationHandler- Parameters:
pUri
- The uripHandler
- The authoriaztion handler- Returns:
- A connection if one is available,
null
otherwise
-
returnAvailableConnectionToPool
public boolean returnAvailableConnectionToPool(HttpClient httpClient)
Add the connection to the pool. Connection is added as available connection. Use methodaddConnectionToPool(HttpClient)
to add the connection without being available for reuse.- Parameters:
httpClient
- connection that is to be added to the pool- Returns:
- true if connection was added otherwise false
-
removeConnectionFromPool
public boolean removeConnectionFromPool(HttpClient httpClient)
Removes a connection completly from the pool. The connection is not closed by this method, that has to be done by the caller.- Parameters:
httpClient
- connection that is to be removed from the pool- Returns:
- true if connection was removed otherwise false
-
closePool
public void closePool(boolean pKeepActive)
-
finalize
protected void finalize()
- Overrides:
finalize
in classjava.lang.Object
-
getPoolSize
public int getPoolSize()
Returns poolSize- Returns:
- The value of poolSize.
-
-