Re: PerThread service unique?

2012-04-30 Thread Thiago H. de Paula Figueiredo
On Mon, 30 Apr 2012 13:15:22 -0300, Manuel Sugawara  
manuel.sugaw...@gmail.com wrote:



Hi all,


Hi!

I have a service that is marked with @Scope(ScopeConstants.PERTHREAD).  
Can I assume that there will be just *one* instance of this service per  
thread or there may be multiple instances?.


One per thread (maybe zero, if it ends up not being used in a given  
thread). If you take a look at them in a debugger, the injected service  
object may look like there's a single shared instance, but actually it  
acts as a proxy and delegates method calls to the appropriate service  
instance for that thread.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: PerThread service unique?

2012-04-30 Thread Manuel Sugawara
On Mon, Apr 30, 2012 at 11:32 AM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:


 One per thread (maybe zero, if it ends up not being used in a given
 thread). If you take a look at them in a debugger, the injected service
 object may look like there's a single shared instance, but actually it acts
 as a proxy and delegates method calls to the appropriate service instance
 for that thread.


I was trying to explain the symptoms with a colleague and all the sudden I
learnt where the problem was, and of course, It was not tapestry. Sorry
about the noise

Regards,
Manuel.