LoganBerryExportImpl.Mesa
Copyright © 1985, 1986 by Xerox Corporation. All rights reserved.
Last modified by Swinehart, January 31, 1986 7:17:49 pm PST
DIRECTORY
Commander USING [ CommandProc, Register ],
CommandTool USING [ NextArgument ],
ExplicitExport USING [ ExportExplicitly ],
LoganBerryRpcControl USING [ ExportInterface ],
LoganBerryRpcServerImpl USING [ ServerDispatcher ],
IO,
Names USING [ CurrentRName, CurrentPasskey ],
Log USING [ Problem, ReportFR ],
RPC USING [ ExportFailed, matchAllVersions, ShortROPE ],
UserProfile USING [ Token ]
;
LoganBerryExportImpl: CEDAR PROGRAM
IMPORTS Commander, CommandTool, IO, Names, Log, RPC, LoganBerryRpcControl, UserProfile
ExplicitExport, NamesGVRpcServerImpl
SHARES LoganBerryRpcServerImpl
= {
OPEN IO;
Data
ROPE: TYPE= RPC.ShortROPE;
exported: BOOLFALSE;
Import Procedure
LBExport: PROC [instance: ROPENIL] RETURNS [success: BOOL] = {
ENABLE
RPC.ExportFailed => { Log.Problem["Couldn't export LoganBerry.Lark"]; CONTINUE; };
IF instance=NIL THEN
instance ← UserProfile.Token[key: "ThrushServerInstance", default: "Morley.Lark"];
IF exported THEN {
Log.ReportFR[remark: "ExportInterface[LoganBerry.Lark, %s] already done", where: $System, a1: rope[instance]];
RETURN;
};
LoganBerryRpcControl.ExportInterface [
interfaceName: [
type: "LoganBerry.Lark",
instance: instance
],
user: Names.CurrentRName[],
password: Names.CurrentPasskey[]
];
ExplicitExport.ExportExplicitly["LoganBerry.Lark", instance, RPC.matchAllVersions, RPC.matchAllVersions, LoganBerryRpcServerImpl.ServerDispatcher];
exported ← TRUE;
Log.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."];
}.