• 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

MessageDrivenBean-Doubt

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HF EJB: PGNO:447

Sharpen Your Pencil:

Of the Three methods(ejbCreate,ejbRemove(),onMessage()) which one the Compiler Cares About.

I Checked all the three options, Please correct me if iam wrong.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The MessageDrivenBean interface haven�t the ejbCreate() method, so I think that is the problem, it just have setMessageDrivenContext(...) and ejbRemove(). The question is so tricky.

Regards,
 
vinod balaji
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If we consider the life cycle of Message Driven bean , ejbCreate() is required and moreover even in PGNO 447 Point No 1 says we need ejbCreate() in bean. Please clarify my doubt on this.
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The compiler cares about every method. That's what the compiler does.

Why would the compiler not care about a method that is coded?

If you want to know which method in an MDB is used for message processing, is, that's a different story.

If you write a method in a class, and compile the class, the compiler will compile every method. If you code all three methods, and any of them have a syntax problem, the compiler will complain.

Perhaps the questions should be rephrased.

-Cameron McKenzie
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you absolutely need:
ejbRemove() - from MessageDrivenBean Interface - and
onMessage(Message m) - from MessageListener Interface

without them - it won't compile.

Regards,
Flom
 
Beware the other head of science - it bites! Nibble on this message:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic