This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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: 5006
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic