LarkRemoteControlServerImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last Edited by: Swinehart, May 16, 1986 11:22:55 am PDT
DIRECTORY
Commander USING [ CommandProc, Register ],
IO,
LarkControl USING [ BootLark, GetLark, LarkData ],
LarkRemoteControl,
LarkRemoteControlRpcControl,
LupineRuntime USING [ BindingError ],
Pup USING [ Address ],
Rope USING [ ROPE ],
RPC USING [ ExportFailed, matchAllVersions ],
VoiceUtils USING [ CmdOrToken, CurrentRName, CurrentPasskey, MakeRName, Problem, ReportFR ]
;
LarkRemoteControlServerImpl: CEDAR PROGRAM
IMPORTS Commander, IO, LarkControl, LarkRemoteControlRpcControl, LupineRuntime, RPC, VoiceUtils
EXPORTS LarkRemoteControl = {
OPEN IO;
BootLark: PUBLIC PROC[lark: Pup.Address] RETURNS [outcome: BOOLTRUE] ={
larkData: LarkControl.LarkData = LarkControl.GetLark[lark];
IF larkData=NIL THEN RETURN[FALSE];
LarkControl.BootLark[larkData];
};
ExptCmd: Commander.CommandProc = {
[cmd: Commander.Handle] RETURNS [result: REF ANY ← NIL, msg: ROPE ← NIL]
ENABLE
RPC.ExportFailed => {
VoiceUtils.Problem["Couldn't export LarkRemoteControl.Lark"]; CONTINUE; };
instance: Rope.ROPE ← VoiceUtils.MakeRName[
VoiceUtils.CmdOrToken[cmd, "ThrushServerInstance", "Morley.Lark"], rName];
LarkRemoteControlRpcControl.UnexportInterface [!LupineRuntime.BindingError=>CONTINUE];
LarkRemoteControlRpcControl.ExportInterface [
interfaceName: [
type: "LarkRemoteControl.Lark",
instance: instance
],
user: VoiceUtils.CurrentRName[],
password: VoiceUtils.CurrentPasskey[]
];
VoiceUtils.ReportFR[remark: "ExportInterface[LarkRemoteControl.Lark, %s]", a1: rope[instance], where: $System];
};
Commander.Register["ExportLarkRemote", ExptCmd, "ExportLarkRemote <instance[Strowger]>\nMakes the LarkRemoteControl interface available."];
}.
Swinehart, September 9, 1985 10:47:13 am PDT
Created -- allows rudimentary control of larks by end-user RPC command.
Expect this to grow.
changes to: DIRECTORY, LarkRemoteControl