----- Original Message -----
From: "Julien Viet" <julien(a)julienviet.com>
To: "Ken Finnigan" <kfinniga(a)redhat.com>
Cc: gatein-dev(a)lists.jboss.org
Sent: Monday, March 25, 2013 5:08:56 PM
Subject: Re: [gatein-dev] CDI Portlet Implementation
sorry for late answer
On Mar 21, 2013, at 7:35 PM, Ken Finnigan < kfinniga(a)redhat.com
>
wrote:
> I'm in the process of implementing the CDI support for
> GenericPortlet
> and would everyone's thoughts on how the changes in gatein-pc
> should
> be integrated into gatein-portal.
> The changes in gatein-pc are purely around lifecycle
modifications
> and enhancements, and don't entail anything CDI specific within
> them.
yes hopefully the next portlet spec will standardize it something.
> However, gatein-portal/component/pc is modified to add the
listener
> to perform CDI injection within ExoPortletApplicationDeployer, and
> the code for the listener brings with it the need for CDI on the
> classpath of the module.
> My current thinking is to create a gatein-portal/component/cdi
> module
> that contains the listener code, with dependencies on CDI, etc.
> Then
> in ExoPortletApplicationDeployer I try to instantiate the listener
> based on the class name, and do nothing if that fails.
will this use rely standard CDI SPI or CDI Servlet integration ? do
you have details about that ?
The gatein-portal/component/cdi module will only have a dependency to the CDI
API artifact, not anything servlet specific for CDI.
> I see the benefit of this being that we don't then have to
ensure
> that each package option we provide also bundles a CDI
> implementation, as neither Tomcat or Jetty support CDI OOTB. So
> ExoPortletApplicationDeployer can simply not add the listener for
> CDI when the class is not present, and whether its present is
> determined by packaging.
Will that work with the Weld / Tomcat integration (like described
here
http://www.lucubratory.eu/getting-weld-cdi-into-tomcat-7/ ) ?
I believe that link describes the same way to setup Weld in Tomcat as the
Weld docs do.
My plan is to bundle Weld into the Tomcat build process so that Weld
Servlet is included. It wouldn't be possible to make it completely
unintrusive, as the developer will need to add some config to their webapp,
as described at the link. As its not possible to do that globally, to
my knowledge.
> Does that sound ok?
yes, overall your work is interesting and my main concern is that it
can work in non native CDI environment that provide an integration
with Weld (like explained before).
I'm packaging it in such a way that if a portlet doesn't use CDI, then it
should act as before, and if Weld is not bundled (for Tomcat), then it
will also act as before.
Basically it will be setup so that if CDI is present and the portlet uses CDI,
then it will do its thing, otherwise it will stay out the way.
> Also, the CDI scope implementations I think are best suited to
be
> in
> a new repo under gatein on github, which contains the scopes and
> the
> CDI extension to activate them. And once again the packaging will
> be
> updated to include it for only environments that contain a CDI
> implementation, such as AS.
> Thanks
> Ken
> ========================
> Senior Software Engineer / JBoss Enterprise Middleware Red Hat,
> Inc.
> _______________________________________________
> gatein-dev mailing list
> gatein-dev(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/gatein-dev