• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MDB definition question

 
Prasad Shindikar
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The MessageListener is in javax.jms package.
 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Prasad Shindikar
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prasad, please QuoteYourSources
 
Prasad Shindikar
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question is from javabeat.net mock tests for scbcd 5.0
 
Umakanth Godavarthy
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic