LupineMarshalTestBinder.mesa.
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last edited by BZM on 12-May-82 19:35:26.
Last edited by Bob Hagmann, February 8, 1985 5:14:42 pm PST
DIRECTORY
LupineExerciser USING [ TestInterface],
LupineMarshalTestRpcControl USING [ExportInterface, ImportNewInterface,
InterfaceRecord, UnexportInterface ],
PrincOpsUtils USING [IsBound],
Rope USING [ROPE],
RPC USING [ExportFailed, ImportFailed, InterfaceName, MakeKey],
UserCredentials USING [Get];
LupineMarshalTestBinder: PROGRAM
IMPORTS
LupineExerciser,
clientControl: LupineMarshalTestRpcControl,
serverControl: LupineMarshalTestRpcControl,
PrincOpsUtils,
RPC: RPC,
UserCredentials
EXPORTS LupineExerciser =
BEGIN
TestInterface: PUBLIC clientControl.InterfaceRecord;
name, password: Rope.ROPE;
Remote Binding Routines for LupineMarshalTest.
BindingFailed: SIGNAL [{import, export}] = CODE;
MarshalTestInterface: RPC.InterfaceName;
ImportTestProgram:
PROC =
BEGIN
IF ~PrincOpsUtils.IsBound[RPC.ImportFailed] THEN RETURN;
IF PrincOpsUtils.IsBound[clientControl.ImportNewInterface]
THEN LupineExerciser.TestInterface ← clientControl.ImportNewInterface [interfaceName: MarshalTestInterface
! RPC.ImportFailed => {SIGNAL BindingFailed[import]; RETRY} ];
END;
ExportTestProgram:
PROC =
BEGIN
IF ~PrincOpsUtils.IsBound[RPC.ExportFailed] THEN RETURN;
IF PrincOpsUtils.IsBound[serverControl.ExportInterface]
THEN {
serverControl.ExportInterface [
interfaceName: MarshalTestInterface,
user: name,
password: RPC.MakeKey[password]
! RPC.ExportFailed => {SIGNAL BindingFailed[export]; RETRY} ];
};
END;
UnimportTestProgram:
PROC =
BEGIN
IF ~PrincOpsUtils.IsBound[RPC.ImportFailed] THEN RETURN;
IF PrincOpsUtils.IsBound[clientControl.UnimportInterface] THEN clientControl.UnimportInterface;
END;
UnexportTestProgram:
PROC =
BEGIN
IF ~PrincOpsUtils.IsBound[RPC.ExportFailed] THEN RETURN;
IF PrincOpsUtils.IsBound[serverControl.UnexportInterface]
THEN serverControl.UnexportInterface;
END;
Module Initialization.
This one module is used for both importing and exporting, and can be
used in clients, servers, or both combined.
[name, password] ← UserCredentials.Get[];
MarshalTestInterface ← [instance: name];
ExportTestProgram[]; -- Try to export.
ImportTestProgram[]; -- Try to import.
END. -- LupineMarshalTestBinder.