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

what is the exact defination of container callback

 
manish ahuja
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • 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
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic