File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Call Back Methods" Watch "Call Back Methods" New topic

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.

Deepak Bala

Joined: Feb 24, 2006
Posts: 6662

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
I agree. Here's the link:
subject: Call Back Methods
It's not a secret anymore!