LarkRemoteControlServerImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last Edited by: Swinehart, September 9, 1985 1:53:07 pm PDT
DIRECTORY
Commander USING [ CommandProc, Register ],
CommandTool USING [ NextArgument ],
IO,
LarkControl USING [ BootLark, GetLark, LarkData ],
LarkRemoteControl,
LarkRemoteControlRpcControl,
Log USING [ Problem, ReportFR ],
Names USING [ CurrentRName, CurrentPasskey],
Rope USING [ ROPE ],
RPC USING [ ExportFailed ],
RPCPkt USING[Machine],
UserProfile USING [ Token ]
;
LarkRemoteControlServerImpl:
CEDAR
PROGRAM
IMPORTS Commander, CommandTool, IO, LarkControl, LarkRemoteControlRpcControl, Log, Names, RPC, UserProfile
EXPORTS LarkRemoteControl = {
OPEN IO;
BootLark:
PUBLIC
PROC[lark: RPCPkt.Machine]
RETURNS [outcome:
BOOL←
TRUE] ={
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 => {
Log.Problem["Couldn't export LarkRemoteControl.Lark"]; CONTINUE; };
instance: Rope.ROPE ← CommandTool.NextArgument[cmd];
IF instance =
NIL
THEN instance ←
UserProfile.Token[key: "ThrushServerInstance", default: "Morley.Lark"];
LarkRemoteControlRpcControl.ExportInterface [
interfaceName: [
type: "LarkRemoteControl.Lark",
instance: instance
],
user: Names.CurrentRName[],
password: Names.CurrentPasskey[]
];
Log.ReportFR[remark: "ExportInterface[LarkRemoteControl.Lark, %s]", a1: rope[instance], where: $System];
};
Commander.Register["ExportLarkRemote", ExptCmd, "ExportLarkRemote Strowger.Lark makes the LarkRemoteControl interface available."];
}.