Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Call Back Methods

 
Glenny Dsilva
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not clear with call back methods. Can anybody explain with a simple example. Are methods defined in the interface are called callback methods?.

Callback methods are used in event handling can anyone give me an example of such type.

Thanks
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Call back methods are ones that are "called back" after something happens. For example a client may order an ice cream and wait for it to be made. A call back method named say - onIceCream() will notify the client that the ice cream is now ready to be eaten. Some one will have to execute the onIceCream() method to tell the client that the ice cream is ready.

In EJBs for example the container will call back certain methods to notify the bean that something has happened. Example: ejbPassivate() is called before a bean is passivated. This is to let the bean know that it is about to be passivated and it should prepare itself for the same.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic