LoganBerryExportImpl.Mesa
Copyright © 1985, 1986 by Xerox Corporation. All rights reserved.
Last modified by Swinehart, May 16, 1986 3:06:13 pm PDT
DIRECTORY
Commander USING [ CommandProc, Register ],
CommandTool USING [ NextArgument ],
ExplicitExport USING [ ExportExplicitly ],
LoganBerryRpcControl USING [ ExportInterface ],
LoganBerryRpcServerImpl USING [ ServerDispatcher ],
IO,
RPC USING [ ExportFailed, matchAllVersions, ShortROPE ],
UserProfile USING [ Token ],
VoiceUtils USING [ CurrentRName, CurrentPasskey, Problem, ReportFR ]
;
LoganBerryExportImpl:
CEDAR
PROGRAM
IMPORTS Commander, CommandTool, IO, RPC, LoganBerryRpcControl, UserProfile, VoiceUtils
ExplicitExport, NamesGVRpcServerImpl
SHARES LoganBerryRpcServerImpl
Data
ROPE: TYPE= RPC.ShortROPE;
exported: BOOL←FALSE;
Import Procedure
LBExport:
PROC [instance:
ROPE←
NIL]
RETURNS [success:
BOOL] = {
ENABLE
RPC.ExportFailed => { VoiceUtils.Problem["Couldn't export LoganBerry.Lark"]; CONTINUE; };
IF instance=
NIL
THEN
instance ← UserProfile.Token[key: "ThrushServerInstance", default: "Morley.Lark"];
IF exported
THEN {
VoiceUtils.ReportFR[remark: "ExportInterface[LoganBerry.Lark, %s] already done", where: $System, a1: rope[instance]];
RETURN;
};
LoganBerryRpcControl.ExportInterface [
interfaceName: [
type: "LoganBerry.Lark",
instance: instance
],
user: VoiceUtils.CurrentRName[],
password: VoiceUtils.CurrentPasskey[]
];
ExplicitExport.ExportExplicitly["LoganBerry.Lark", instance, RPC.matchAllVersions, RPC.matchAllVersions, LoganBerryRpcServerImpl.ServerDispatcher];
exported ← TRUE;
VoiceUtils.ReportFR[
remark: "ExportInterface[LoganBerry.Lark, %s]", a1: rope[instance], where: $System];
};
User command
CmdLBExport: Commander.CommandProc = { []←LBExport[CommandTool.NextArgument[cmd]]; };
Initialization
Commander.Register["ExportLoganBerry", CmdLBExport, "ExportLoganBerry [Instance]\nSupply a remote LoganBerry."];
}.