Hi everybody,
I fear I have not quite understood what you mean by « There is a
different behavior if the inherited class is a component or a
simple class for EJB.” In fact what do you mean by “behavior” ?
What I have understood from the spec is :
Annotations configuring the component type and clients views declared
in a session bean super class are not inherited in a subclass :
annotations and interfaces has to be specified for the subclass for it
to be considered has a session bean (spec 4.9.2.1 of the EJB 3.2 spec).
There is no component inheritance semantic
But configurations of container services specified in a super class
(basic class or session bean superclass) are inherited by a session
bean subclass following specific rules (ie. Transaction [8.3.7 ] and
security[12.3.2.1]. There is an implementation inheritance semantic.
Is this that what you mean ?
Note that test under GlassFish tend to confirm these two assertions
For the interception case, I’m quite OK with what you.
Anyway it would be a good thing if you precise a little more in the
4.9.2.1part to avoid confusion.
In the case I have well understood the two upper assertions, there is
another point who is worried me: the fact that a super component could
be declared as a Stateful , and a subcomponent as a Stateless which
could lead to strange behavior. If I don’t mistake, there is nothing
written in the spec about this. What if the child access to the parent
conversational state?
In the case of a session bean class deriving from a session bean
superclass, you should maybe add a warning who states that a session
bean subcomponent type should be of the type of the super component or
a type having a wider scope. That is a stateless session bean should
not inherit from a stateful or singleton session bean.
Regards,
Alex