peibel wrote:
Hi,

Can someone help us?

We have a tapestry 5 application and we need add a thread because of new
requirements.

We'd like to inject some tapestry objects in a our application -
HibernateSessionManager etc. - to get access to our database from the new
thread.

You can inject Tapestry service only on other Tapestry-ioc managed service, it's the way all IOC framework work: then can handle only object in their scope (in particular, they have to manage the object creation to be able to refer to the good existing object instance that should be injected).

So, two cases :
- your new thread is next to your T5 app : T5 can't do anything for you - neither could Guice, or Spring - by "a new Thread", you mean a new object (service) that should be thread-dependent. In this case, you could manage it's creation with T5 and the "per thread scope", and in this case, you would be able to fully use T5 IoC and so, inject other service into it.

For service scoping, see : http://tapestry.apache.org/tapestry5/tapestry-ioc/service.html

I hope it helps, and perhaps I misunderstood something, so don't hesitate to ask precisions.

--
Francois Armand
Etudes & Développements J2EE
Groupe Linagora - http://www.linagora.com
Tél.: +33 (0)1 58 18 68 28
-----------
http://fanf42.blogspot.com
InterLDAP - http://interldap.org FederID - http://www.federid.org/
Open Source identities management and federation


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to