RPCService.mesa
Copyright Ó 1993 by Xerox Corporation. All rights reserved.
Created by Theimer, December 17, 1992 7:51:43 am PST
Theimer, April 29, 1993 9:30 am PDT
Package that exports access to a Cedar Commander via an RPC interface. Simple Cedar services need only make sure this package has been started up in order to export themselves. More sophisticated services can also export registrations of themselves to the NMS name service and the LocationBroker via the RegisterWithRPCService procedure.
DIRECTORY
IO,
Rope;
RPCService: CEDAR DEFINITIONS ~
BEGIN
ROPE: TYPE ~ Rope.ROPE;
Register: PROC [nmsInstance: ROPE, cmd: ROPE, doLBRegistrations: BOOLEANFALSE, oldNmsInstance: ROPENIL];
Register a command with the RPC service. A registration in the NMS name service will be made of the form ((name, "JoinApp") (instance, 'nmsInstance') (cmd, 'cmd')). Interested parties seeing this registration will know that they can send an RPC request to this Cedar world to invoke 'cmd'. The details of the RPC protocol used for this are described in /project/ubi/doc/JoinAppProtocol.ps. When an incoming RPC request occurs the RPC service invokes 'cmd' by stuffing it into a Commander instance and returning the Commander's results to the client. Also, if 'doLBRegistrations' is TRUE then each incoming RPC request that contains location information will result in a registration being made in the LocationBroker of the form ((type, "JoinApp") (name, 'nmsInstance') (cmd, 'cmd')). If 'oldNmsInstance' is non-NIL then any old registration under that instance name is removed.
UnRegister: PROC [nmsInstance: ROPE];
Unregister from the RPC service. Removes any registrations made in the NMS and LocationBroker.
END.