DIRECTORY Commander USING [CommandProc, Register], ComputeServerClient USING [RemoteSuccess, StartService], Rope USING [Cat, IsEmpty, ROPE]; RCClientImpl: CEDAR PROGRAM IMPORTS Commander, ComputeServerClient, Rope ~ BEGIN ConvertSuccess: PROC [found: BOOL, success: ComputeServerClient.RemoteSuccess, msg: Rope.ROPE] RETURNS [newMsg: Rope.ROPE] ~ { updateMSG: PROC [prefix, suffix: Rope.ROPE ] RETURNS [newMsg: Rope.ROPE] = { IF suffix.IsEmpty[] THEN RETURN [prefix]; newMsg _ Rope.Cat[prefix, " (because ", suffix, ")"]; }; SELECT success FROM true => { }; false => { IF ~found THEN msg _ updateMSG["compute server command not found", msg] ELSE msg _ updateMSG["compute server success was false (Computer Server bug?)", msg]; }; aborted => { msg _ updateMSG["compute server command aborted", msg]; }; communicationFailure => { msg _ updateMSG["communicationFailure", msg]; }; cantImportController => { msg _ updateMSG["cantImportController", msg]; }; cantImportServer => { msg _ updateMSG["cantImportServer", msg]; }; serverTooBusy => { msg _ updateMSG["serverTooBusy", msg]; }; ENDCASE => msg _ updateMSG["unknown error code", msg]; newMsg _ msg; }; RemoteCommand: Commander.CommandProc ~ { found: BOOL; success: ComputeServerClient.RemoteSuccess; [found: found, success: success, remoteMsg: msg] _ ComputeServerClient.StartService[service: "RemoteCommand", cmdLine: cmd.commandLine, in: cmd.in, out: cmd.out]; msg _ ConvertSuccess[found, success, msg]; }; Commander.Register[key: "RemoteCommand", proc: RemoteCommand, doc: "Execute a command on some compute server (RemoteCommand )"]; END. „RCClientImpl.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Eric Nickell October 19, 1985 4:28:17 pm PDT Κw˜šœ™Icodešœ Οmœ1™