DIRECTORY Rope USING [ROPE] ; RemoteFile: CEDAR DEFINITIONS ~ { ROPE: TYPE ~ Rope.ROPE; ServerHandle: TYPE ~ REF ServerObject; ServerObject: TYPE ~ RECORD [ flavor: ATOM, name: ROPE, -- e.g. "Ivy-STP", "Palain-NFS" procs: ServerProcs, data: REF ]; ServerProcs: TYPE ~ REF ServerProcsObject; ServerProcsObject: TYPE ~ RECORD [ sweep: SweepProc _ NIL, validate: ValidateProc, getProcs: GetProcsProc ]; SweepProc: TYPE ~ PROC [h: ServerHandle, seconds: CARD]; ValidateProc: TYPE ~ PROC [h: ServerHandle] RETURNS [obsolete: BOOL, downMsg: ROPE]; GetProcsProc: TYPE ~ PROC [h: ServerHandle, view: ATOM] RETURNS [procs: REF]; Register: PROC [flavor: ATOM, getServer: GetServerProc]; GetServerProc: TYPE ~ PROC [server: ROPE] RETURNS [h: ServerHandle, downMsg: ROPE]; GetServer: PROC [server: ROPE] RETURNS [h: ServerHandle]; GetProcs: PROC [h: ServerHandle, view: ATOM] RETURNS [procs: REF] ~ INLINE { RETURN[h.procs.getProcs[h, view]] }; SetCachedServer: PROC [server: ROPE, flavor: ATOM]; ClearCachedServer: PROC [server: ROPE]; Error: ERROR [code: ATOM, msg: ROPE]; }... ,RemoteFile.mesa Copyright Σ 1987 by Xerox Corporation. All rights reserved. Demers, November 7, 1987 2:00:36 pm PST Copied Types Server handles Called a few (~10) times a minute by this package for miscellaneous housekeeping. The seconds argument specifies how long it's been since the last call. Called to validate a handle that might be stale. If obsolete=TRUE, the handle is out of date and should be replaced (by calling appropriate getServerProc). IF downMsg#NIL, the server is known to exist but is down. Return procs record for specified view of given server. ! Error[$notImplemented, ...] Registration Register an(other) remote file ops implementation. Any existing registration for "flavor" disappears. "getServer" may be NIL, to clear a registration. Tries to find a server of the given name. If successful, creates ServerHandle h and return [h, NIL]. If no server responds and no server is known to exist, returns [NIL, NIL]. If server is known to exist but is not responding, returns [NIL, message], Does not raise Error! The caller may Process.Abort a GetServerProc. Lookup Tries to find a server of the given name, using the server cache. ! Error[$serverNotKnown, ...] ! Error[$serverNotAvailable, ...] Controlling the flavor of a cached server. If this is necessary the network environment is probably screwed up. Force server of given name to be of given flavor. Error Codes $serverNotKnown : can't look up the server name. $serverNotAvailable : can't contact it. $notImplemented : requested view not implemented by server. $software : "can't happen" Κx˜codešœ™K™