You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by Gurkan Erdogdu <gu...@yahoo.com> on 2010/04/13 21:40:03 UTC

Re: EE-Integration Question: How does one do CDI injection on Java EE component classes ?

Hi Rohit;

I did it for Apache Tomcat integration for injecting CDI Beans into Servlets/Filters/Tag Libraries. I use OWBInjector class. You could look at org.apache.webbeans.web.tomcat.TomcatInstanceListener, TomcatAnnotProcessor in tomcat6 module.

OWBInjector is a generic class not related with EJB. It takes Java EE components instance and inject CDI beans into it.

Thanks;

--Gurkan




________________________________
From: Rohit Kelapure <ke...@gmail.com>
To: dev@openwebbeans.apache.org
Sent: Tue, April 13, 2010 7:49:53 PM
Subject: Re: EE-Integration Question: How does one do CDI injection on Java EE  component classes ?

Gurkan,

This will work with EJBs.  How does a container provide injection of
CDI beans into other EE types say JAX-WS Web Services or HTTPServlets
?

Does OpenWebBeans expose an extension point for EE containers to
plugin their own injection service  for injection of CDI managed beans
into EE types.
The mirror image of ResourceInjectionService ?

--Thanks,
Rohit Kelapure


On Mon, Apr 12, 2010 at 10:25 AM, Gurkan Erdogdu
<cg...@gmail.com> wrote:
> Hello Rohit;
>
> Could you look at the OWBInjector utility class? This is responsible for
> injecting into EE components instances.
>
> When EE container destroys EE component, you will also destroy creational
> contexts via OWBInjector.
>
> OWBInjector injector = new OWBInjector();
> injector.inject(instance, creational);
> injector.release(); //on ee component destroying
>
> For EJB case, I have updated OpenWebBeansEJBInterceptor. Please look at it.
> Basically, you will add it to every EJB Beans that is contained in JSR299
> module.
>
> Thanks;
>
> --Gurkan
>
> 2010/4/12 Rohit Kelapure <ke...@gmail.com>
>
>> Team,
>>
>> OpenWebBeans provides the ResourceInjectionService API  for injection
>> of Java EE injectable resources into CDI managed beans.  This works
>> well and we have integrated the ResourceInjectionService API in our EE
>> container.
>>
>> We need guidance on how OWB handles CDI managed bean injection  into
>> EE components.
>>
>> Are we to follow the WELD approach of achieving this through the CDI
>> defined InjectionTarget SPI. Should an EE container extend/compose the
>> BeanManager and expose a fireProcessInjectionTarget(Class) utility
>> method ? How does this integrate with the OpenWebBeansEjbPlugin. ?
>>
>> I am looking for a high level overview of how this will work in OWB
>> and the code that currently supports this feature and what is yet to
>> be written ?
>>
>> --Thanks,
>> Rohit Kelapure
>>
>
>
>
> --
> Gurkan Erdogdu
> http://gurkanerdogdu.blogspot.com
>



      ___________________________________________________________________
Yahoo! Türkiye açıldı!  http://yahoo.com.tr
İnternet üzerindeki en iyi içeriği Yahoo! Türkiye sizlere sunuyor!

Re: EE-Integration Question: How does one do CDI injection on Java EE component classes ?

Posted by Rohit Kelapure <ke...@gmail.com>.
Perfect ! Will dig into OWBInjector !

On Tue, Apr 13, 2010 at 3:40 PM, Gurkan Erdogdu <gu...@yahoo.com>wrote:

> Hi Rohit;
>
> I did it for Apache Tomcat integration for injecting CDI Beans into
> Servlets/Filters/Tag Libraries. I use OWBInjector class. You could look at
> org.apache.webbeans.web.tomcat.TomcatInstanceListener, TomcatAnnotProcessor
> in tomcat6 module.
>
> OWBInjector is a generic class not related with EJB. It takes Java EE
> components instance and inject CDI beans into it.
>
> Thanks;
>
> --Gurkan
>
>
>
>
> ________________________________
> From: Rohit Kelapure <ke...@gmail.com>
> To: dev@openwebbeans.apache.org
> Sent: Tue, April 13, 2010 7:49:53 PM
> Subject: Re: EE-Integration Question: How does one do CDI injection on Java
> EE  component classes ?
>
> Gurkan,
>
> This will work with EJBs.  How does a container provide injection of
> CDI beans into other EE types say JAX-WS Web Services or HTTPServlets
> ?
>
> Does OpenWebBeans expose an extension point for EE containers to
> plugin their own injection service  for injection of CDI managed beans
> into EE types.
> The mirror image of ResourceInjectionService ?
>
> --Thanks,
> Rohit Kelapure
>
>
> On Mon, Apr 12, 2010 at 10:25 AM, Gurkan Erdogdu
> <cg...@gmail.com> wrote:
> > Hello Rohit;
> >
> > Could you look at the OWBInjector utility class? This is responsible for
> > injecting into EE components instances.
> >
> > When EE container destroys EE component, you will also destroy creational
> > contexts via OWBInjector.
> >
> > OWBInjector injector = new OWBInjector();
> > injector.inject(instance, creational);
> > injector.release(); //on ee component destroying
> >
> > For EJB case, I have updated OpenWebBeansEJBInterceptor. Please look at
> it.
> > Basically, you will add it to every EJB Beans that is contained in JSR299
> > module.
> >
> > Thanks;
> >
> > --Gurkan
> >
> > 2010/4/12 Rohit Kelapure <ke...@gmail.com>
> >
> >> Team,
> >>
> >> OpenWebBeans provides the ResourceInjectionService API  for injection
> >> of Java EE injectable resources into CDI managed beans.  This works
> >> well and we have integrated the ResourceInjectionService API in our EE
> >> container.
> >>
> >> We need guidance on how OWB handles CDI managed bean injection  into
> >> EE components.
> >>
> >> Are we to follow the WELD approach of achieving this through the CDI
> >> defined InjectionTarget SPI. Should an EE container extend/compose the
> >> BeanManager and expose a fireProcessInjectionTarget(Class) utility
> >> method ? How does this integrate with the OpenWebBeansEjbPlugin. ?
> >>
> >> I am looking for a high level overview of how this will work in OWB
> >> and the code that currently supports this feature and what is yet to
> >> be written ?
> >>
> >> --Thanks,
> >> Rohit Kelapure
> >>
> >
> >
> >
> > --
> > Gurkan Erdogdu
> > http://gurkanerdogdu.blogspot.com
> >
>
>
>
>       ___________________________________________________________________
> Yahoo! Türkiye açıldı!  http://yahoo.com.tr
> İnternet üzerindeki en iyi içeriği Yahoo! Türkiye sizlere sunuyor!
>