Next: Transport mechanisms
Prev: Distributed Services
Up: NetClasses
Top: Top
3.15.5. Remote Method Invocation (RMI)
The distributed services paradigm enables methods to be
invoked on objects from remote machines. The RMI facility is
a higher level communications facility that again shields the
developer from port number and host name considerations.
The focus of RMI is on ease of use. An RMI invocation
requires no stub or skeleton files, protocol compilers, or RPC
mechanisms. To enable object X of class C to have its method
M invoked from a remote machine, a programmer uses the
RMI::advertise method to advertise method X.M.
If an application wants to invoke the M method on object X
from a remote machine, it uses the RMI::invoke("X.M") method.
Parameter passing in RMI can be based on any of the three
NetClasses object transports (generic C++, NIH-object, or
TypedObject). Synchronous and asynchronous RMI versions exist.
Multiple agents can advertise method X.M. The one that is
actually invoked is transparent to the client. RMI thus
provides an easy mechanism for developing scalable distributed
applications.