[cdi-dev] Session Bean business interface inheritance

Fabien Marsaud fabmars at gmail.com
Wed Jun 6 06:21:23 EDT 2012


Hi
There's a bunch of small discrepancies like that between EJB and CDI. e.g
GF-16186 <http://java.net/jira/browse/GLASSFISH-16186> I reported one year
ago which ended up on WELD-921 <https://issues.jboss.org/browse/WELD-921>.
And we also had isues with covariant methods on @Local interfaces in the
past.

With CDI gradually percolating through all EE, one day or another - from
EE7 I hope - EJB and CDI will have to behave the same way.

In the context of this WELD-1133 it would be preferable to align EJB on
CDI, unless of course some important usecase gets harmed (but I don't see
which). Else the spec clash will remain and in a few years users will keep
wonrdering what we were thinking.

fm.


On Tue, Jun 5, 2012 at 5:50 PM, Martin Kouba <mkouba at redhat.com> wrote:

> Hi,
>
> recently we had an issue with regard to Session Bean business interface
> inheritance when running CDI TCK 1.0.4.SP3 on GlassFish - see also
> WELD-1133 [1]. The following discussion revealed possible specification
> conflict (EJB 3.1 vs CDI 1.0). Pete Muir asked me to write some brief
> summary. So here it is :-)
>
> The problem: it seems that session bean business interface inheritance is
> not allowed in EJB 3.1
> (4.9.2.1 Session Bean Superclasses)
>
> Let's assume this code:
>
> @Local
> interface Bar {}
>
> @Local
> interface Foo extends Bar {
> }
>
> @Stateless
> class FooBean implements Foo {
> }
>
> According to the spec (EJB 3.1) the set of exposed client views of FooBean
> should only be Foo. Not Foo and Bar.
>
> However the CDI spec defines bean types for a session bean in a following
> way: "The unrestricted set of bean types for a session bean contains all
> local interfaces of the bean and their superinterfaces" (3.2.2. Bean types
> of a session bean).
>
> Note that some EJB implementations DO support this kind of inheritance out
> of the box (e.g. JBoss AS 7 EJB module).
>
> Martin
>
> [1]
> https://issues.jboss.org/browse/WELD-1133
>
> --
> Martin Kouba
> JBoss Quality Assurance Engineer
> E-mail: mkouba at redhat.com
> Web: www.cz.redhat.com
> Red Hat Czech s.r.o., Purkyňova 99/71, 612 45, Brno, Czech Republic
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>



-- 
http://www.suntriprecords.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20120606/27385011/attachment.html 


More information about the cdi-dev mailing list