Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 93600 invoked from network); 10 Feb 2004 17:48:40 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 10 Feb 2004 17:48:40 -0000 Received: (qmail 10202 invoked by uid 500); 10 Feb 2004 17:47:55 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 10116 invoked by uid 500); 10 Feb 2004 17:47: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 Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 9907 invoked from network); 10 Feb 2004 17:47:52 -0000 Received: from unknown (HELO main.gmane.org) (80.91.224.249) by daedalus.apache.org with SMTP; 10 Feb 2004 17:47:52 -0000 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AqbzH-0000n5-00 for ; Tue, 10 Feb 2004 18:47:55 +0100 Received: from 217.112.237.100 ([217.112.237.100]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue Feb 10 17:47:55 2004 Received: from sylvain by 217.112.237.100 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue Feb 10 17:47:55 2004 X-Injected-Via-Gmane: http://gmane.org/ To: users@cocoon.apache.org From: Sylvain Wallez Subject: Re: Is it possible to have poolable actions ? Date: Tue, 10 Feb 2004 18:47:52 +0100 Lines: 38 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 217.112.237.100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: fr, en, en-us In-Reply-To: Sender: news X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Jorg Heymans wrote: >> >> The reason is that Poolable is useful *only* for components that do >> have a state that cannot be shared between uses of that components. >> Actions have a single act() method and therefore 99% of them are >> stateless, and consequently implement ThreadSafe. > > > Can i for an action with a ServiceManager instance variable (my class > implements serviceable) implement ThreadSafe then instead of Poolable? > Is there a possibility of getting in trouble when two threads are > simultaneously doing a component lookup on the same servicemanager > instance? > > Most of my components have servicemanager as the only instance variable. The Serviceable interface from which you get the ServiceManager is part of the Avalon lifecycle interfaces, which are called when a component instance is created. These methods are called once in the lifetime of an object, be it ThreadSafe or Poolable. So data you get in one of the lifecycle interfaces (LogEnabled, Contextualizable, Serviceable, Configurable and Initializable) is not considered as defining a runtime state. Therefore, components having only a ServiceManager field can safely be made ThreadSafe. Sylvain -- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects } Orixo, the opensource XML business alliance - http://www.orixo.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org