hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Question on HTTPClient-675
Date Tue, 21 Jul 2009 08:27:57 GMT
On Mon, Jul 20, 2009 at 09:52:42PM +0200, Ortwin Gl?ck wrote:
> David,
> 
> D H wrote:
> > One question that one of our developers had was where to put the single
> > instance of MultiThreadedHttpConnectionManager to be able to use it across
> > threads from an EJB?
> > He will use the ServletContext and ServletContextListener for the
> > applications but isn't sure for EJBs.
> 
> It's a bit of a matter of taste. I think it makes a good candidate for an MBean.
> If JBoss is your appserver, you can easily create a ServiceMBean for this
> purpose and set it up in the jboss-app.xml of your EAR or any other jboss.xml
> (of an EJB-JAR or SAR) of your choice. This way you could also easily add some
> MBean operations & properties for adminitrative purposes like flushing the
> cache, or returning statistics.
> 
> Odi
> 

I agree with Odi it all boils down to a matter of personal taste. There are a
few more options to consider

(1) JCA (JEE Connector Architecture) resource adaptor. Portable across
different JEE containers but horribly difficult to develop 


(2) If your applications needs to access resource from only one HTTP server (or
very few), my personal recommendation would be to wrap HttpClient plus a
_single_ connection connection manager into a stateless session bean and let
the JEE container take care of instance pooling and thread safety.

Hope this helps

Oleg


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message