This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Software Teaming: A Mob Programming, Whole-Team Approach and have Woody Zuill and Kevin Meadows on-line!
See this thread for details.
  • 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

callback and lifecycle methods

 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Are callback and lifecycle methods of EJB different?
-Sainudheen
 
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would say YES.
 
Sainudheen Mydeen
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can somebody explain or show me a link where I can get more details about the differences?
Thanks
-Sainudheen
 
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lifecycle methods generally use the callback mechanism to pass control and data to the bean.
 
Sainudheen Mydeen
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I read ejbActivate, ejbPassivate, setEntityContext etc are known as callback methods. Are they not life-cycle methods? OR they are so called based on the context?
-Sainudheen
 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lifecycle methods are indeed Container callbacks. Basically, anything that's not a business method from the component interface is considered a Container callback. That means anything with "ejb" in front of the name. But you won't need to care about this distinction in terminology for the exam. As long as you know the circumstances under which methods are called on the bean class, you will be fine. The key things are to understand the differences between the behavior of lifecycle methods such as ejbCreate() and ejbRemove() on all of the different bean types. Or things like... which ones are invoked as a direct result of a client invocation. For example, ejbRemove() is called on a stateFUL session bean or entity bean as a direct result of a client call to remove(), but on a stateLESS session bean, the ejbRemove() Container callback is NOT called as a result of a client invocation (but rather because the Container just decided it was time to start killing some beans to shrink the pool size... and when the client calls remove() on a stateLESS bean, the Container just laughs and says, "Do you think I CARE?"
cheers,
kathy
 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It cleared.

Lifecycle methods are indeed Container callbacks

 
reply
    Bookmark Topic Watch Topic
  • New Topic