Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 13846 invoked from network); 22 Nov 2005 04:51:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Nov 2005 04:51:19 -0000 Received: (qmail 21215 invoked by uid 500); 22 Nov 2005 04:50:55 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 21075 invoked by uid 500); 22 Nov 2005 04:50:54 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 21026 invoked by uid 99); 22 Nov 2005 04:50:54 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Nov 2005 20:50:54 -0800 Received-SPF: neutral (asf.osuosl.org: 64.151.110.219 is neither permitted nor denied by domain of Ralph.Goers@dslextreme.com) Received: from [64.151.110.219] (HELO mail.gosmtp.com) (64.151.110.219) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Nov 2005 20:52:26 -0800 Received: from [192.168.10.132] (adsl-66-51-196-164.dslextreme.com [66.51.196.164]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.gosmtp.com (Postfix) with ESMTP id B6380D9 for ; Mon, 21 Nov 2005 20:21:41 -0800 (PST) Message-ID: <4382A396.1030300@dslextreme.com> Date: Mon, 21 Nov 2005 20:50:30 -0800 From: Ralph Goers User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: components not as factory or pooled References: <005901c5ec30$101082b0$f83110ac@iacturuslaptop> <437DE9EE.8010109@d-haven.org> <006301c5ec52$aa3c9e60$f83110ac@iacturuslaptop> <437DF14E.4000700@d-haven.org> <009101c5ec58$b8acb290$f83110ac@iacturuslaptop> <437DFD68.6020501@d-haven.org> <005e01c5ee95$88e34260$f83110ac@iacturuslaptop> In-Reply-To: <005e01c5ee95$88e34260$f83110ac@iacturuslaptop> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Iacturus wrote: > As the NonThreadSafeComponent uses some API which cannot be made > threadsafe, there can only be one method of NonThreadSafeComponent > executed at one time. I cannot change this API and it really has to be > used exclusively. > > The behavoir i expected to get, is that > 1) there is a single instance of NonThreadSafeComponent which may be > looked up and be used by thread1 > 2) all other threads looking up this component will have to wait while > the thread1 executes some logic > 3) after the thread1 releases the instance of NonThreadSafeComponent it > will be available to the next thread > > (Part 2) should be done by the ServiceManager) > > Thanks, Robert Robert, It doesn't work that way. The ServiceManager either a) returns a singleton if the object is marked ThreadSafe or b) a pooled instance of the object if it is not ThreadSafe. In b) if the pool isn't large enough then a new object is created and then destroyed when it is released. Neither of these is what you are asking for. You need to create a ThreadSafe component and then synchronize the non-threadsafe API call. Ralph --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org