Return-Path: Delivered-To: apmail-hc-dev-archive@www.apache.org Received: (qmail 13260 invoked from network); 21 Jul 2009 08:27:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Jul 2009 08:27:24 -0000 Received: (qmail 39862 invoked by uid 500); 21 Jul 2009 08:28:27 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 39801 invoked by uid 500); 21 Jul 2009 08:28:27 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 39730 invoked by uid 99); 21 Jul 2009 08:28:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jul 2009 08:28:27 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [92.42.190.144] (HELO ok2cons2.nine.ch) (92.42.190.144) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jul 2009 08:28:18 +0000 Received: by ok2cons2.nine.ch (Postfix, from userid 1000) id C9C6C4BA471; Tue, 21 Jul 2009 10:27:57 +0200 (CEST) Date: Tue, 21 Jul 2009 10:27:57 +0200 From: Oleg Kalnichevski To: HttpComponents Project Subject: Re: Question on HTTPClient-675 Message-ID: <20090721082757.GA9057@ok2cons2.nine.ch> References: <4A368361.9090405@odi.ch> <4A36B801.90305@apache.org> <4A394327.5090505@apache.org> <4A64CB0A.8080109@odi.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A64CB0A.8080109@odi.ch> User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Checked: Checked by ClamAV on apache.org 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