Generally it is recommended to have a single instance of HttpClient per communication component or even per application. However, if the application makes use of HttpClient only very infrequently, and keeping an idle instance of HttpClient in memory is not warranted, it is highly recommended to explicitly shut down the multithreaded connection manager prior to disposing the HttpClient instance. This will ensure proper closure of all HTTP connections in the connection pool.
Contexts are torn down in the oposite order to which they are set up (i.e. the first context set up is the last to be torn down).
If more than one teardown() method thrown an exception then only the first is propegated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|