• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

what is the exact defination of container callback

 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All

Just wanted more clarification on this one. What do we mean when we say container callback methods.
Why is the business method not a container callback method.

Or is it that the EJBObject invokes the bean's business method where as the other methods namely setSessionContext, ejbActivate, ejbPassivate & ejbRemove are called by the container & the EJBObject has no role to play during the same.

In that case why is ejbCreate not a callback method

Can someone ellaborate

Bye
Manish
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A container callback method is a method that the container needs to invoke on some object for carrying out its work. Usually a callback method is declared in an interface (SessionBean, EntityBean, SessionSynchronization, etc) that classes will implement in order to satisfy a contract with the container in which they will run. In that sense, ejbCreate is also a callback method except that it is not explicitely declared in the *Bean interfaces because the developer may choose to append some custom suffix to its name, as in ejbCreateWithNameAndPlace(String name, String place) for instance.

Usually, everything that goes through the EJBObject comes from the client. Now, a client may invoke some method that will cause the container to invoke a callback on the bean before executing the desired method. For instance, if an entity bean is passivated and the client invokes a method on it, the container will first call ejbActivate() and ejbLoad() on it before serving the request.

Does this make sense?
 
I'm thinking about a new battle cry. Maybe "Not in the face! Not in the face!" Any thoughts tiny ad?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic