Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MessageDrivenBean-Doubt

 
vinod balaji
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • 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.
 
Rodrigo Dinis
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
 
Flom Xanther
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic