org.sblim.cimclient.internal.http

Class HttpClientPool

public class HttpClientPool extends Object

Class HttpClientPool implements a pool for http client connections
Constructor Summary
HttpClientPool(WBEMConfiguration pConfiguration)
Ctor.
Method Summary
booleanaddConnectionToPool(HttpClient httpClient)
Add the connection to the pool, but does NOT add it as available connection.
voidclosePool()
Closes the pool.
WBEMConfigurationgetConfigurationContext()
Returns the configuration context of this pool
intgetNumberOfAllConnections()
Returns the number of connections in this pool that are available/free for (re-)use.
intgetNumberOfAvailableConnections()
Returns the number of all connections in this pool.
intgetPoolSize()
Returns poolSize
SSLContextgetSslContext()
Returns the SSL context for the clients in this pool.
booleanremoveConnectionFromPool(HttpClient httpClient)
Removes a connection completely from the pool.
HttpClientretrieveAvailableConnectionFromPool(URI pUri, AuthorizationHandler pHandler)
Returns the available connections of this pool for a given URI&AuthorizationHandler
booleanreturnAvailableConnectionToPool(HttpClient httpClient)
Add the connection to the pool.

Constructor Detail

HttpClientPool

public HttpClientPool(WBEMConfiguration pConfiguration)
Ctor.

Parameters: pConfiguration The configuration for this session. Must be non-null.

Method Detail

addConnectionToPool

public boolean addConnectionToPool(HttpClient httpClient)
Add the connection to the pool, but does NOT add it as available connection. Use method returnAvailableConnectionToPool to also add the connection to the available connections.

Parameters: httpClient connection that is to be added to the pool

Returns: true if connection was added otherwise false

closePool

public void closePool()
Closes the pool. This will disconnect all clients in the pool.

getConfigurationContext

public WBEMConfiguration getConfigurationContext()
Returns the configuration context of this pool

Returns: The configuration

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

getPoolSize

public int getPoolSize()
Returns poolSize

Returns: The value of poolSize.

getSslContext

public SSLContext getSslContext()
Returns the SSL context for the clients in this pool. The context is initialized on the first call of this method (lazy initialization).

Returns: The SSL context

removeConnectionFromPool

public boolean removeConnectionFromPool(HttpClient httpClient)
Removes a connection completely from the pool.

Parameters: httpClient connection that is to be removed from the pool

Returns: true if connection was removed otherwise false

retrieveAvailableConnectionFromPool

public HttpClient retrieveAvailableConnectionFromPool(URI pUri, AuthorizationHandler pHandler)
Returns the available connections of this pool for a given URI&AuthorizationHandler

Parameters: pUri The uri pHandler The authorization 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 method addConnectionToPool 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

Copyright © 2005, 2010 IBM Corporation. All Rights Reserved.