This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring 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
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

MDB definition question  RSS feed

 
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.
 
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.
 
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.
 
Sheriff
Posts: 10445
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
 
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!