This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Call Back Methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Call Back Methods" Watch "Call Back Methods" New topic
Author

Call Back Methods

Glenny Dsilva
Ranch Hand

Joined: May 09, 2005
Posts: 42
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

Joined: Feb 24, 2006
Posts: 6661
    
    5

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.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Call Back Methods
 
Similar Threads
ejbPassivate question?
what are container callback methods??
Container callback and inline methods
callback methods
What are the call back methods in EJB