You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by sebb <se...@gmail.com> on 2006/01/13 20:09:33 UTC
Closing HttpClient connections created by the Managers
The MultiThreaded Connection Manager has methods
shutdown()
static shutdownAll()
which presumably include shutting all connections
However the Simple Connection Manager does not.
Just wondering why this is?
As far as I can tell the only way to shut the connection provided by
the Simple Manager is to call
closeIdleConnections(N) where N <= 0
It would be useful to include the shutdown methods in the HttpClient interface.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
Re: Closing HttpClient connections created by the Managers
Posted by sebb <se...@gmail.com>.
On 13/01/06, Roland Weber <ht...@dubioso.net> wrote:
> sebb wrote:
> > The MultiThreaded Connection Manager has methods
> >
> > shutdown()
> > static shutdownAll()
> >
> > which presumably include shutting all connections
> >
> > However the Simple Connection Manager does not.
> > Just wondering why this is?
>
> Originally, neither had a shutdown() method. Then we encountered a
> need to shut down the cleanup thread for idle connections of the
> MultiThreadedConnectionManager. We never had a similar need for the
> SimpleConnectionManager, so we left it as an implementation specific
> method outside of the interface.
>
> > As far as I can tell the only way to shut the connection provided by
> > the Simple Manager is to call
> >
> > closeIdleConnections(N) where N <= 0
> >
> > It would be useful to include the shutdown methods in the HttpClient interface.
>
> Why HttpClient? You can get from the client to the connection manager, so
> it should be sufficient to have the shutdown in the manager's interface:
>
> httpClient.getHttpConnectionManager().shutdown();
Sorry, I meant the HttpConnectionManager interface.
> Please file a feature request in bugzilla. We'll have a tough time
OK
> defining a static shutdown method in an interface though, so don't
> count on that one ;-)
indeed...
> On the other hand, adding a new method to the interface will break
> custom connection manager implementations that might be out there.
> Don't expect this change to be introduced before 3.1.
>
Though one could implement it in SimpleHttpConnectionManager right away.
Also one could introduce a new interface
"HttpConnectionManagerWithShutdown" - but with a better name ;-)
S.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
Re: Closing HttpClient connections created by the Managers
Posted by Roland Weber <ht...@dubioso.net>.
sebb wrote:
> The MultiThreaded Connection Manager has methods
>
> shutdown()
> static shutdownAll()
>
> which presumably include shutting all connections
>
> However the Simple Connection Manager does not.
> Just wondering why this is?
Originally, neither had a shutdown() method. Then we encountered a
need to shut down the cleanup thread for idle connections of the
MultiThreadedConnectionManager. We never had a similar need for the
SimpleConnectionManager, so we left it as an implementation specific
method outside of the interface.
> As far as I can tell the only way to shut the connection provided by
> the Simple Manager is to call
>
> closeIdleConnections(N) where N <= 0
>
> It would be useful to include the shutdown methods in the HttpClient interface.
Why HttpClient? You can get from the client to the connection manager, so
it should be sufficient to have the shutdown in the manager's interface:
httpClient.getHttpConnectionManager().shutdown();
Please file a feature request in bugzilla. We'll have a tough time
defining a static shutdown method in an interface though, so don't
count on that one ;-)
On the other hand, adding a new method to the interface will break
custom connection manager implementations that might be out there.
Don't expect this change to be introduced before 3.1.
cheers,
Roland
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org