com.microsoft.tfs.core.config.httpclient
Interface HTTPClientFactory

All Known Subinterfaces:
ConfigurableHTTPClientFactory
All Known Implementing Classes:
DefaultHTTPClientFactory

public interface HTTPClientFactory

An HTTPClientFactory is used by a TFSTeamProjectCollection to lazily create an HttpClient instance. An HTTPClientFactory is supplied to a TFSTeamProjectCollection by a ConnectionAdvisor .

TFSTeamProjectCollection allows only a single thread to use a HTTPClientFactory, and TFSTeamProjectCollection does not retain any reference to a HTTPClientFactory after it is finished using it.

For a default implementation, see DefaultHTTPClientFactory.

See Also:
TFSTeamProjectCollection, ConnectionAdvisor, DefaultHTTPClientFactory
Since:
TEE-SDK-10.1
Thread-safety:
thread-compatible

Method Summary
 void dispose(HttpClient httpClient)
           Called to dispose an HttpClient that was previously obtained from a call to newHTTPClient().
 HttpClient newHTTPClient()
          Called to obtain a new HttpClient instance.
 

Method Detail

newHTTPClient

HttpClient newHTTPClient()
Called to obtain a new HttpClient instance.

Returns:
a new HttpClient (must not be null)

dispose

void dispose(HttpClient httpClient)

Called to dispose an HttpClient that was previously obtained from a call to newHTTPClient().

This method is called by TFSConnection.close() to clean up any http client resources. It can be assumed that the specified HttpClient instance will no longer be used after calling this method.

Parameters:
httpClient - an HttpClient instance to dispose (must not be null)


© 2015 Microsoft. All rights reserved.