The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Question on Message Driven Beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Question on Message Driven Beans" Watch "Question on Message Driven Beans" New topic

Question on Message Driven Beans

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345


In the @MessageDriven annotation, we have an attribute called messageListenerInterface. Why do we need to specify this when the MDB class imements this in it's declaration?

SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Sergio Tridente
Ranch Hand

Joined: Mar 22, 2007
Posts: 329

Hi Jothi,

Accordingly to section 5.4.2 of the ejb core specification:

If the message-driven bean class implements more than one interface other than java.io.Serializable, java.io.Externalizable, or any of the interfaces defined by the javax.ejb package, the message listener interface must be specified by the messageListenerInterface element of the MessageDriven annotation or the messaging-type element of the message-driven deployment descriptor element.

SCJP 1.4 (88%) - SCJP 5.0 Upgrade (93%) - SCWCD 1.4 (97%) - SCBCD 5.0 (98%)
It is sorta covered in the JavaRanch Style Guide.
subject: Question on Message Driven Beans
Similar Threads
chatting option
Developing our own Exam Simulator?
Outgrowing our server(s)!
ejb-jar file 's content