<> <> <> <> 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; <> 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; <> END; UnexportTestProgram: PROC = BEGIN IF ~PrincOpsUtils.IsBound[RPC.ExportFailed] THEN RETURN; IF PrincOpsUtils.IsBound[serverControl.UnexportInterface] THEN serverControl.UnexportInterface; END; <> <> <> [name, password] _ UserCredentials.Get[]; MarshalTestInterface _ [instance: name]; ExportTestProgram[]; -- Try to export. ImportTestProgram[]; -- Try to import. END. -- LupineMarshalTestBinder.