ComputeServerClientStubImpl.mesa
Stub for calls from Clients into the Compute Server. The real procedures in the Client support code on the workstation are registered, and used via this code. We do it this way to allow user interfaces to call into ComputeServerClient and hence into this module without fear that the Client support code has not been run, and hence the interface procedures have not been bound.
Last Edited by: Bob Hagmann, May 13, 1985 3:36:49 pm PDT
Copyright © 1984 by Xerox Corporation. All rights reserved.
DIRECTORY
ComputeServerClient,
IO,
Rope;
ComputeServerClientStubImpl: CEDAR MONITOR
EXPORTS ComputeServerClient
= BEGIN
Declarations
ROPE: TYPE = Rope.ROPE;
STREAM: TYPE = IO.STREAM;
RealStartServiceProc: ComputeServerClient.StartServiceProc ← NIL;
RealBestServerStatsProc: ComputeServerClient.BestServerStatsProc ← NIL;
Service Initialization and Status
BestServerStats: PUBLIC PROC RETURNS[success: ComputeServerClient.RemoteSuccess ← false, selfIsBest: BOOLTRUE, FOM: REAL ← 1.0] = {
IF RealBestServerStatsProc = NIL THEN RETURN [false, FALSE, 0.0]
ELSE {
[success, selfIsBest, FOM] ← RealBestServerStatsProc[];
};
};
StartService: PUBLIC PROC [service: ROPE, version: ROPE, cmdLine: ROPE, in, out: STREAM, queueService: BOOLFALSE, timeToWait: INT ← 3600, retries: NAT ← 3] RETURNS [found: BOOLTRUE, success: ComputeServerClient.RemoteSuccess ← false, remoteMsg: ROPENIL, serverInstance: ROPENIL] = {
IF RealStartServiceProc = NIL THEN RETURN [FALSE, false, NIL, NIL]
ELSE {
[found, success, remoteMsg, serverInstance] ← RealStartServiceProc[service, version, cmdLine, in, out, queueService, timeToWait, retries];
};
};
Registration
RegisterProcs: PUBLIC PROC [StartService: ComputeServerClient.StartServiceProc, BestServerStats: ComputeServerClient.BestServerStatsProc ] = {
RealStartServiceProc ← StartService;
RealBestServerStatsProc ← BestServerStats;
};
Initialization
END.