Win a copy of Machine Learning with TensorFlow this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

MDB's superclass as MDB - allowed or not?

 
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy Ranchers!

Quick question - can a MDB have a superclass which is another MDB? I'm a bit confused after reading this:

EJB 3.1 spec, p. 151, 5.6.2 wrote:A message-driven bean class must not have a superclass that is itself a message-driven bean class.


EJB 3.1 spec, p. 151, 5.6.3 wrote:A message-driven bean class is permitted to have superclasses that are themselves message-driven bean classes.



So... can or can not? :-)

Thanks in advance!

Cheers.
 
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone clear this out? This is a kind of inconsistency.
 
Bartender
Posts: 543
4
Netbeans IDE Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just wanted to bring this back from the dead as I've just come across this inconsistency in the spec, and would like to have it cleared out.

So, can an MDB have a superclass that is also an MDB... or not?
 
Creator of Enthuware JWS+ V6
Posts: 3386
311
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dieter,

I have concluded that it is possible (with the same explanation as is used the Session Beans): "the use of message-driven bean classes as superclasses merely represents a convenient use of implementation inheritance, but does not have component inheritance semantics."

in other words:
"A listener interface exposed by a particular message driven bean is not inherited by a subclass"

Message Driven Bean A exposes the message listener interface Echo and Message Driven Bean B exposes the message listener interface Talk, but not Echo (unless explicitly put as an implementer).

I guess this is a theoretical discussion as I can not think of any practical solution where you would need something like this.

Regards,
Frits
 
Dieter Quickfend
Bartender
Posts: 543
4
Netbeans IDE Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So it's permitted - thanks Frits!
 
moose poop looks like football shaped elk poop. About the size of this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic