Re: Inject EJB 3 into Tapestry 4 page
Hi Sorry for Off topic, but that's amazing how simple the solution is, I can't stop wondering how a small group of people (read Hivemind and Tapestry developers) and especially Howard were so smart to create such a beautiful, simple and flexible solution, where such problems like integration with EJB3 can be solved so simple and concise. BTW thank you Denis for the solution, I'll use it in my code as well. Renat On 20/01/07, Denis Souza <[EMAIL PROTECTED]> wrote: I sent an e-mail a few weeks ago asking about injecting EJBs in tapestry pages. I found a way to do it, so I'm sharing it with the list since there were other people interested. It's really very easy. All you have to do is create a hivemind object provider that will supply you with the information you want. Something like this: public class EJBObjectProvider implements ObjectProvider { public Object provideObject(Module module, Class propertyType, String locator, Location location) { return jndiLookup(locator); } } This is a bit simplified. In my case I use a caching mechanism to save on jndi lookups. Then you have to tell hivemind about your new object provider by adding to you hivemodule.xml: I'm also injecting an application state manager for my own logic, but you can use anything here. Also add the following: That's it. Now you can inject any EJBs by simply adding something like this in your page or component: @InjectObject("ejb:myBeanJndiName") public abstract MyBean getMyBean(); I hope it was helpful. I really don't know that much about hivemind use so it took me some tapestry source code exploring to figure this one out. I welcome any suggestions on how to improve this. Cheers, Denis -Original Message- From: Bastian Voigt [mailto:[EMAIL PROTECTED] Sent: quarta-feira, 20 de dezembro de 2006 13:40 To: Tapestry users Cc: Denis Souza Subject: Re: Inject EJB 3 into Tapestry 4 page Hi, did you find out anything? I am having the same problem. Regards Bastian Voigt On Monday 18 December 2006 21:44, Denis Souza wrote: > That's just about what I need, but for EJB 3. This service seems to assume > EJB 2.x since it requires a home interface. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Best regards, Renat Zubairov - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Inject EJB 3 into Tapestry 4 page
I sent an e-mail a few weeks ago asking about injecting EJBs in tapestry pages. I found a way to do it, so I'm sharing it with the list since there were other people interested. It's really very easy. All you have to do is create a hivemind object provider that will supply you with the information you want. Something like this: public class EJBObjectProvider implements ObjectProvider { public Object provideObject(Module module, Class propertyType, String locator, Location location) { return jndiLookup(locator); } } This is a bit simplified. In my case I use a caching mechanism to save on jndi lookups. Then you have to tell hivemind about your new object provider by adding to you hivemodule.xml: I'm also injecting an application state manager for my own logic, but you can use anything here. Also add the following: That's it. Now you can inject any EJBs by simply adding something like this in your page or component: @InjectObject("ejb:myBeanJndiName") public abstract MyBean getMyBean(); I hope it was helpful. I really don't know that much about hivemind use so it took me some tapestry source code exploring to figure this one out. I welcome any suggestions on how to improve this. Cheers, Denis -Original Message- From: Bastian Voigt [mailto:[EMAIL PROTECTED] Sent: quarta-feira, 20 de dezembro de 2006 13:40 To: Tapestry users Cc: Denis Souza Subject: Re: Inject EJB 3 into Tapestry 4 page Hi, did you find out anything? I am having the same problem. Regards Bastian Voigt On Monday 18 December 2006 21:44, Denis Souza wrote: > That's just about what I need, but for EJB 3. This service seems to assume > EJB 2.x since it requires a home interface. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Inject EJB 3 into Tapestry 4 page
No, nothing. I didn't look very far since it's not critical for me. I'm thinking that I could eventually write a hivemind service that wraps any EJB I need. It wouldn't be as clean, but it would be enough, at least in my case. Denis -Original Message- From: Bastian Voigt [mailto:[EMAIL PROTECTED] Sent: quarta-feira, 20 de dezembro de 2006 13:40 To: Tapestry users Cc: Denis Souza Subject: Re: Inject EJB 3 into Tapestry 4 page Hi, did you find out anything? I am having the same problem. Regards Bastian Voigt On Monday 18 December 2006 21:44, Denis Souza wrote: > That's just about what I need, but for EJB 3. This service seems to assume > EJB 2.x since it requires a home interface. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Inject EJB 3 into Tapestry 4 page
Hi, did you find out anything? I am having the same problem. Regards Bastian Voigt On Monday 18 December 2006 21:44, Denis Souza wrote: > That's just about what I need, but for EJB 3. This service seems to assume > EJB 2.x since it requires a home interface. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Inject EJB 3 into Tapestry 4 page
That's just about what I need, but for EJB 3. This service seems to assume EJB 2.x since it requires a home interface. Thanks anyway, Denis -Original Message- From: Norbert Sándor [mailto:[EMAIL PROTECTED] Sent: segunda-feira, 18 de dezembro de 2006 16:57 To: Tapestry users Subject: Re: Inject EJB 3 into Tapestry 4 page Take a look at http://hivemind.apache.org/hivemind-lib/EJBProxyFactory.html Denis Souza írta: > Anyone know how I can inject a stateless EJB into a tapestry page? Is it > possible to do this with hivemind? > > > > Thanks in advance, > > Denis > > > > > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.432 / Virus Database: 268.15.23/591 - Release Date: 2006.12.17. 15:17 > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Inject EJB 3 into Tapestry 4 page
Take a look at http://hivemind.apache.org/hivemind-lib/EJBProxyFactory.html Denis Souza írta: Anyone know how I can inject a stateless EJB into a tapestry page? Is it possible to do this with hivemind? Thanks in advance, Denis No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.432 / Virus Database: 268.15.23/591 - Release Date: 2006.12.17. 15:17 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]