ThExportOtherImpl.mesa
Last modified by D. Swinehart, November 24, 1984 4:15:52 pm PST
DIRECTORY
Commander,
Log,
Names,
NamesGV,
Rope,
RPC,
RPCBinding,
RPCLupine,
ThPartyRpcControl,
ThPartyRpcServerImpl,
ThVersions
;
ThExportOtherImpl: CEDAR PROGRAM
IMPORTS
Commander,
Log,
Names,
NamesGV,
RPCBinding,
ThPartyRpcServerImpl,
ThVersions
SHARES
RPCBinding, ThPartyRpcServerImpl
= {
stubProtocol: RPC.VersionRange = ThPartyRpcControl.LupineProtocolVersion;
explicitInstance: Rope.ROPE;
explicitlyExported: BOOLFALSE;
ExportThingsWithExplicitInstance: Commander.CommandProc = {
instance: Rope.ROPE = Names.CmdOrToken[cmd: cmd, key: "ThrushServerInstance", default: "Morley.Lark"];
thVR: RPC.VersionRange = ThVersions.ThrushVR;
IF explicitlyExported THEN RETURN;
explicitInstance ← NamesGV.GVGetAttribute[
rName: instance, attribute: $connect, default: NIL];
IF explicitInstance=NIL THEN {
[]←Log.Problem["Trouble in ExportExplicitInstances",$System]; RETURN; };
ExportOneOther["ThParty.Lark", thVR, ThPartyRpcServerImpl.ServerDispatcher];
Log.Report["ExportExplicitInstances[]", $System];
explicitlyExported ← TRUE;
};
ExportOneOther: PROC[interfaceType: Rope.ROPE, version: RPC.VersionRange, dispatcher: RPCLupine.Dispatcher] = TRUSTED {
[]←RPCBinding.AddToExportTable[[interfaceType, explicitInstance, version], dispatcher, stubProtocol];
};
Commander.Register["ExportOthers", ExportThingsWithExplicitInstance, "ExportOthers <instanceName (opt)> -- Export with host-based instances for fast binding."];
}.