You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Jonathan Gallimore <jo...@gmail.com> on 2009/04/02 01:01:56 UTC

Re: Tutorial on how to integrate into web servers

That's great, sounds like it will be a really useful piece of functionality.


Probably the best place to start off is having a look at the classes in the
openejb-tomcat-catalina module. I started looking at TomcatWebAppBuilder
when I first looked at the OpenEJB/Tomcat integration. This class is invoked
by GlobalListenerSupport which is an implementation of LifecycleListener,
and this receives events from Tomcat (its added to Tomcat's listeners by the
tomcat-loader module). TomcatWebAppBuilder calls the OpenEJB assembler to
deploy the EJB modules, and uses InjectionBuilder and TomcatJndiBuilder to
set up dependency injection between OpenEJB and Tomcat (ie handling
injecting EJBs and resources into Servlets) and merging the OpenEJB JNDI
with the Tomcat JNDI.

Please do have a look at the code I did for functional testing (
http://openejb.apache.org/functional-testing-with-openejb-jetty-and-selenium.html),
particularly the embedded server class, as this deploys an EJB module with
OpenEJB, and a web module to Jetty, both running as embedded servers, and
wires up the necessary JNDI stuff for the web app, and I think I got it to
handle injecting EJBs into servlets, I think you might find this useful.

I think that this preview functionality would make a great maven plugin -
I'm thinking along the lines of what jetty:run does, but with all your EJBs
deployed as well.

I think this is a really interesting project, I'm looking forward to seeing
how it develops. Good luck, and please post if we can help further.

Cheers

Jon


On Sun, Mar 22, 2009 at 11:32 PM, Marcelo Dias <ma...@gmail.com> wrote:

>
>
> 2009/3/19 Jonathan Gallimore <jo...@gmail.com>
>
>
>>
>> On Wed, Mar 18, 2009 at 1:25 PM, Marcelo Dias <ma...@gmail.com> wrote:
>>
>>> Hi Jon,
>>>
>>> Thank you for your reply.
>>> I think it's ok to e-mail direct you, instead the e-mail list.
>>
>>
>> I don't mind the direct e-mail, but if its ok with you, I'd like to copy
>> this back to the list, as some of the others on the list are much more
>> experienced with this sort of thing than me, and I'm sure their input will
>> be valuable.
>>
>>
>>> Actually, I'm studying to make a good student proposal in GSoC to use the
>>> OpenEJB with Jetty as a server.
>>> But, I still don't know how to start doing that.
>>
>>
>> Start off having a look at:
>> http://wiki.apache.org/general/SummerOfCode2009 I don't think OpenEJB
>> have suggested any Summer of code projects yet. I'm not familiar with
>> Apache's participation in the Summer of code scheme, so again, this is
>> definitely best asked on the list. I don't know what commitment is required
>> on our part as mentors, but if I am able to participate in some way I'd
>> certainly be interested.
>>
>>
>>> Should I start studying the JNDI thing? Or how they work apart? Or how
>>> integrate a general web-server with a EJB container?
>>
>>
>>>
>>> It will be very helpful if you can help me in this concern: how to start
>>> studying?
>>> Recommending me some readings.
>>
>>
>> I'd start off by looking at the Tomcat integration code in the OpenEJB svn
>> repository and understanding how it works. All the Tomcat integration is in
>> the modules under
>> https://svn.apache.org/repos/asf/openejb/trunk/openejb3/assembly/openejb-tomcat/
>>
>> Its also worth looking at the code I put together for the functional
>> testing article, as it already does the basic JNDI wiring for Jetty.
>>
>> Hope that's helpful.
>>
>> Jon
>>
>
>
> Hi Jon.
>
> Actually, it is already a Eclipse Foundation idea for GSoC.
> The Eclipse Sub-project WTP (that includes J2EE Preview Adapter) uses the
> Jetty server to preview a web project when it is on development phase. It
> would be nice if the J2EE Preview Adapter supports EJB modules too. So
> that's where this idea came from.
>
> I already have a mentor, is Kaloyan Raev from Eclipse Foundation. But I'll
> need all of kind of help. It'd be nice if you could help me.
>
> Thank you so much for your advices, it is helping me a lot!
>
> Just one more thing that I'd want to ask you for.
> Due to the use of instrumentation in the openejb-tomcat module it is hard
> to have a initial high view of how the integration works. Is there any
> documentation of the integration of OpenEJB with Tomcat? Even a very brief
> plain description will be very helpful.
>
> It is ok to me to copy it back to the e-mail list. So I already did it.
>
> One more time!
> Thank you very much.
>
> Marcelo
>