I thought it was also interesting/cool that proxies are serializable, so that 
you can do things like add a service as a property to a Quartz job and 
(provided it's a job that runs in the same VM lifetime) it works perfectly.

Alfie.

-----Original Message-----
From: Howard Lewis Ship [mailto:hls...@gmail.com] 
Sent: 02 September 2010 03:59
To: Tapestry users
Subject: Re: T5.1 and Threaded Background Tasks

Services in Tapestry IoC are always proxies(*); the proxies
encapsulate thread-safe instantiation of the service, as well as the
lifecycle of the service (singleton or perthread).

Please see the documentation of the PerthreadManager service for some
additional notes.

So, yes, it is valid for a service to start a thread and for that
thread to do work with injected services even while other threads are
invoking methods on the same services. No problems at all.

(*) The exception is services with no service interface, just an
implementation class, which can't be proxied. They will, however,
still be instantiated in a thread safe manner, just a bit earlier than
necessary.



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

Reply via email to