What actually is a 'callback' concept in RMI, and how...
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rajneesh_Garg
Posted On:   Thursday, March 15, 2001 11:17 PM

What actually is a 'callback' concept in RMI, and how does it work?

Re: What actually is a 'callback' concept in RMI, and how...

Posted By:   Govind_Seshadri  
Posted On:   Wednesday, March 21, 2001 09:48 PM

Event-driven programming in languages like C has traditionally used function pointers to pass references to functions, which are then asynchronously invoked in response to an "event" (timers, mouse clicks, and the like). Java uses interfaces to give you access to the same functionality in an object-oriented world. Here, the interface defines the methods that may be invoked by any object with access to the interface. The real "functionality" is present within some other object that actually implements this interface and it is "called back" by the target object.


Implementing callbacks, however, is not without challenges -- particularly in a distributed-object environment like RMI. Callbacks are implemented in RMI by setting the client itself as an exportable remote object (that is, make it implement some remote interface), then registering a reference of this with the remote-server object. This way, the server can asynchronously invoke the remote methods of any connected client in the same way the client can asynchronously invoke the methods implemented within the remote-server objects. See the Dr. Dobb's article on "Implementing callbacks with Java RMI" for complete details.

Re: What actually is a 'callback' concept in RMI, and how...

Posted By:   Edward_Harned  
Posted On:   Monday, March 19, 2001 11:30 AM

A callback is really just an RMI invocation in the other direction. See Sun's tutorial on callback for a full description.
About | Sitemap | Contact