aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes MDB definition question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "MDB definition question" Watch "MDB definition question" New topic
Author

MDB definition question

Prasad Shindikar
Ranch Hand

Joined: Feb 18, 2007
Posts: 114
Which of the following code snippets correctly declares a Message-Driven Bean by name 'TestMessageDrivenBean'?


Correct Answer: 1 Can anyone explain why ?

I think, since none of the code snippets have a @MessageDriven annotation, and an xml descriptor file is not provided as part of the question, none of the answer choices are correct.
Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

The MessageListener is in javax.jms package.


SCJP, SCJD, SCWCD, OCPJBCD
Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1162
    
    1

may be, this question want to test the knowledge of full qualified name of MessageListener rather than usage of @MessageDriven annotation.

Also, one more reason that i can think of is that may be you are solving the questions based on EJB 2.1 (or less) version where EJB annotations were not present.

~ abhay


Oracle Java Web Service Developer (1z0-897), Oracle certified Java 7 Programmer, SCJA 1.0, SCJP 5.0, SCWCD 5.0, Oracle SQL Fundamentals I
Prasad Shindikar
Ranch Hand

Joined: Feb 18, 2007
Posts: 114
Supposing that I am aware of the MessageListener's class' fully qualified name, still according to the question, I don't think any snippet correctly defines a MDB. Especially since no xml descriptor is present, which can define the POJO to be an MDB.

I think, specifying the @MessageDriven annotation is also equally important, other than implement MessageListener to call a POJO as an MDB.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10202
    
166

Prasad, please QuoteYourSources

[My Blog] [JavaRanch Journal]
Prasad Shindikar
Ranch Hand

Joined: Feb 18, 2007
Posts: 114
The question is from javabeat.net mock tests for scbcd 5.0
Umakanth Godavarthy
Ranch Hand

Joined: Nov 10, 2005
Posts: 37
The best way to look at it is, given the choices, either you have to select 1 or skip the Q...
Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

Hi guys, I most agree with Prasad, the answer 1 is nearly correct but it does not have any kind of information about the MDB environment (e.g. the destination type, acknowledge, mesageSelector) and, I presume that there is dd somewhere.
The Question is to fuzzy and if I use use the information what they provide then none of the answers are correct - for 1 it mss the info about the mdb.

Regards,
Mihai
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MDB definition question