• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Message listener interface of a Message-Driven Bean?

 
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question is from WhizLabs Diagnostic Exam - Question 21

Which of the following are valid statements regarding the message listener interface required by the message driven bean?

[A] Bean's message listener interface cannot define more than one message listener method.
[B] For multiple methods in message listener interface, it is resource adaptor, which determines which method to call.
[C] Message listener interface has no role to play in determining the supported messaging type by a message driven bean.
[D] Message listener interface actually distinguishes the messaging type a message bean can support



According to WhizLabs, B and D are the correct answers.

I couldn't understand anything about this. Can someone tell me what is this message listener interface, and will it appear on the real exam?
 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you should expect questions about MDB's on the exam (a MDB needs a message listener interface).

I recommend reading chapter 5 in core spec. For instance, parts of Whizzlab's question can be answered directly from 5.4.2.
 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ralph, I know about MDB. But I don't know anything about the message driven listener interface, as it is used in this question.
 
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@MessageDriver annotation has an element whose name is messageListenerInterface. You can specify it this way, or by simply implementing the interface. Most of the time for the exam it is javax.jms,MessageListener with its onMessage() method.
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Raf -- Is there any annotation named MessageDriver?? I guess you probably had meant MessageDriven!
 
Raf Szczypiorski
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yup, @MessageDriven. I always make this typo, not sure why!
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This question actually has two pairs, A or B, C or D. For the first pair, I am not sure. For the second pair, take the example of JMS MessageListner, the onMessage(Message msg) need the JMS message type. So it actually distinguish the message type, which is a javax.jms.Message.

The thing that is confusing here is almost all the examples for MDB is using JMS MessageListener, so our thinking is confined on it. And JMS has its own message types, ObjectMessage, TextMessage and so on. MDB can not distinguish these types. But the "message type" here means a bigger scope. That is, other than JMS, MDB can support other message system.

So for the first pair, the JMS MessageListener only has one method onMessage(). That doesn't mean other message system can only have one method.

Is my understanding right?
 
when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic