-- LupineTimeTestBinder.mesa.
-- Copyright (C) 1985 by Xerox Corporation. All rights reserved.
-- Last edited by BZM on 12-May-82 19:25:22.
-- Bob Hagmann February 8, 1985 5:11:25 pm PST


DIRECTORY
LupineTimeTestRpcControl USING [
 ImportInterface, UnimportInterface,
 ExportInterface, UnexportInterface ],
MesaRPC USING [ExportFailed, ImportFailed, InterfaceName, MakeKey],
Runtime USING [IsBound];


LupineTimeTestBinder: PROGRAM
IMPORTS
 clientControl: LupineTimeTestRpcControl,
 serverControl: LupineTimeTestRpcControl,
 RPC: MesaRPC, Runtime =
BEGIN


-- Remote Binding Routines for LupineTimeTest.

BindingFailed: SIGNAL [{import, export}] = CODE;

TimeTestInterface: RPC.InterfaceName = [instance: "Nelson.PA"];

ImportTestProgram: PROC =
BEGIN
IF ~Runtime.IsBound[RPC.ImportFailed] THEN RETURN;
IF Runtime.IsBound[clientControl.ImportInterface]
THEN clientControl.ImportInterface [
  interfaceName: TimeTestInterface
  ! RPC.ImportFailed => {SIGNAL BindingFailed[import]; RETRY} ];
END;

ExportTestProgram: PROC =
BEGIN
IF ~Runtime.IsBound[RPC.ExportFailed] THEN RETURN;
IF Runtime.IsBound[serverControl.ExportInterface]
THEN serverControl.ExportInterface [
  interfaceName: TimeTestInterface,
  user: "RPCRuntime.PA",
  password: RPC.MakeKey["zzy"]
  ! RPC.ExportFailed => {SIGNAL BindingFailed[export]; RETRY} ];
END;

UnimportTestProgram: PROC =
BEGIN
IF ~Runtime.IsBound[RPC.ImportFailed] THEN RETURN;
IF Runtime.IsBound[clientControl.UnimportInterface]
THEN clientControl.UnimportInterface;
END;

UnexportTestProgram: PROC =
BEGIN
IF ~Runtime.IsBound[RPC.ExportFailed] THEN RETURN;
IF Runtime.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.

ExportTestProgram[]; -- Try to export.
ImportTestProgram[]; -- Try to import.


END. -- LupineTimeTestBinder.
Bob Hagmann February 8, 1985 5:11:25 pm PST
changes to: DIRECTORY