ComputeServerInternal.mesa
The internal server interface for the Summoner. This interface resides on the server, is internal to the Summoner, and is not an RPC interface.
Last Edited by: Bob Hagmann, October 23, 1985 7:45:40 am PDT
Copyright © 1984 by Xerox Corporation. All rights reserved.
DIRECTORY
BasicTime,
Commander,
ComputeServerClient,
ComputeServerCallbacksRpcControl,
ComputeServerControllerRpcControl,
ComputeServerDebuggerRpcControl,
ComputeServerServer,
ComputeServerStatistics,
ComputeServerUserRpcControl,
InterpreterToolPrivate,
IO,
PrincOps,
PupDefs,
Rope,
RPC,
RuntimeError,
SymTab;
ComputeServerInternal: CEDAR DEFINITIONS =
BEGIN
ROPE: TYPE = Rope.ROPE;
STREAM: TYPE = IO.STREAM;
IdleTransitionsEnabled: BOOL;
ActiveServices: INT; -- count of currently active services
myHostName: ROPE;
MyNetAddressRope: ROPE;
ControllerGVName: ROPE;
RemoteCommandDir: ROPE;
LocalCommandDir: ROPE ;
OKToUseLocalDisk: BOOL;
RegisteredProcObject: TYPE = ComputeServerServer.RegisteredProcObject;
RegisteredProcObject: TYPE = RECORD [
version: Rope.ROPE,
service: Rope.ROPE,
commanderProcHandle: Commander.CommandProcHandle ← NIL
];
RegisteredProcHandle: TYPE = REF RegisteredProcObject;
PackageEntryObject: TYPE = RECORD [
package: ROPENIL,
dfCreate: BasicTime.GMT ← BasicTime.nullGMT,
commands: LIST OF ROPENIL,
maintainer: LIST OF ROPENIL,
latestVersion: ROPENIL,
runVersion: ROPENIL,
exclusive: BOOLFALSE,
maxCountActive: INT ← 10000,
nowActive: INT ← 0
];
PackageEntry: TYPE = REF PackageEntryObject;
PackageTable: SymTab.Ref;
CmdEntryObject: TYPE = RECORD [
service: ROPENIL,
package: ROPENIL,
version: ROPENIL,
firstTime: BOOLTRUE,
doQueueing: BOOLFALSE,
okToQueuePosted: BOOLFALSE
];
CmdEntry: TYPE = REF CmdEntryObject;
ConfigEntryObject: TYPE = RECORD [
package: ROPENIL,
dfCreate: BasicTime.GMT ← BasicTime.nullGMT,
maintainer: LIST OF ROPENIL
];
ConfigEntry: TYPE = REF ConfigEntryObject;
ConfigTable: PUBLIC SymTab.Ref;
ActiveServicesListBase: ActiveServicesItem ;
ActiveServicesItem: TYPE = REF ActiveServicesItemObject;
ActiveServicesPointer: TYPE = LONG POINTER TO ActiveServicesItemObject;
StreamEOFState: TYPE = {true, pending, false};
ActiveServicesItemObject: TYPE = RECORD [
next: ActiveServicesItem,
callbacksInterface: ComputeServerCallbacksRpcControl.InterfaceRecord ← NIL,
userInterface: ComputeServerUserRpcControl.InterfaceRecord ← NIL,
listenerPupAddress: PupDefs.PupAddress,
startListenGMT: BasicTime.GMT,
listener: PupListener,
heardDoService: BOOLFALSE,
debugItem: BOOLFALSE,
debuggerInterface: ComputeServerDebuggerRpcControl.InterfaceRecord ← NIL,
h: InterpreterToolPrivate.Handle ← NIL,
originalListenerPupAddress: PupDefs.PupAddress ← [[0],[0],[0,0]],
procHandle: RegisteredProcHandle,
msg: ROPENIL,
success: ComputeServerClient.RemoteSuccess,
remoteStream: IO.STREAMNIL,
clientNetAddressRope: ROPENIL,
clientMachineName: ROPENIL,
packageEntry: PackageEntry,
commandEntry: CmdEntry,
inEOF: BOOLFALSE,
outEOF: StreamEOFState ← false,
doingEnumerate: BOOLFALSE,
callOver: BOOLFALSE,
pleaseAbort: BOOLFALSE
];
PupListener: TYPE = REF PupListenerObject;
PupListenerObject: TYPE;
BufStreamData: TYPE = REF BufStreamDataObject;
BufStreamBufferSize: INT = 128;
bufStreamState: TYPE = {true, pending, false};
BufStreamDataObject: TYPE = RECORD [
inPointer: NAT ← 0,
outPointer: NAT ← 0,
EOF: bufStreamState ← false,
listenerItem: ActiveServicesItem,
buffer: ARRAY [0..BufStreamBufferSize-1] OF CHARALL[' ]
];
CommandTable: SymTab.Ref; -- knowing a command, find the package/version
MarkGuestProcess: PROC [process: PROCESS, data: LONG POINTER] RETURNS [ok: BOOLTRUE, oldData: LONG POINTER];
Establish this process as a guest. data must point to "guest process data"
IsGuestProcess: PROC [] RETURNS [isGuest: BOOL] ;
GetGuestProcessData: PROC [process: PROCESS] RETURNS [data: LONG POINTER];
MarkProcessNotGuest: PROC [process: PROCESS];
Temporarily flag this process as not a guest, but retain "guest process data". All use of FS, UserCredentials and UserProfile will now be done locally.
RemoveMarkProcessNotGuest: PROC [process: PROCESS];
Reverses the effect of MarkProcessNotGuest
MarkProcessUseLocalFS: PROC [process: PROCESS];
Temporarily flag this process as not a guest for FS calls, but retain "guest process data".
RemoveMarkProcessUseLocalFS: PROC [process: PROCESS];
Reverses the effect of MarkProcessUseLocalFS
AddPupAddress: PROC [serverPupAddress: PupDefs.PupAddress, procHandle: RegisteredProcHandle, listener: PupListener] RETURNS [newItem: ActiveServicesItem];
Note a new active service
DeletePupAddress: PROC [serverPupAddress: PupDefs.PupAddress] RETURNS [found: BOOL];
Remove an active service
MatchPupAddress: PROC [serverPupAddress: PupDefs.PupAddress, flagStarted: BOOLFALSE] RETURNS [found: BOOL, item: ActiveServicesItem];
Find an active service by pup address - that's a unique id.
GetClientInterfaceFromCache: PROC [clientInstance: RPC.ShortROPE, forceNewInterface: BOOLFALSE] RETURNS [clientInterface: ComputeServerCallbacksRpcControl.InterfaceRecord ← NIL];
DeleteClientInterfaceFromCache: PROC [clientInterface: ComputeServerCallbacksRpcControl.InterfaceRecord] RETURNS [gotIt: BOOLFALSE];
findDebuggerItemFromInterpreterHandle: PROC [h: InterpreterToolPrivate.Handle] RETURNS [found: BOOL, item: ActiveServicesItem ← NIL];
KillOldUnstartedServices: PROC;
CreatePupByteStreamListener: PROC [
local: PupDefs.PupSocketID, proc: PROCEDURE [STREAM, PupDefs.PupAddress, PupListener, PupDefs.PupAddress], ticks: PupDefs.Tocks,
filter: PROCEDURE [PupDefs.PupAddress]] RETURNS [PupListener];
DestroyPupListener: PROC [listener: PupListener];
ListenerProcess: PROC [stream: STREAM, connectionPupAddress: PupDefs.PupAddress, listener: PupListener, listenerPupAddress: PupDefs.PupAddress];
DontReject: PROCEDURE [PupDefs.PupAddress] ;
inStreamProcs: REF IO.StreamProcs;
outStreamProcs: REF IO.StreamProcs;
inCharsAvail: PROC [self: STREAM, wait: BOOL] RETURNS [INT];
inBufGetChar: PROC [self: STREAM] RETURNS [ch: CHAR];
outBufPutChar: PROC [self: STREAM, char: CHAR];
ControllerInterface: ComputeServerControllerRpcControl.InterfaceRecord;
ServiceEnabled: BOOL;
SendStats: PROC [] RETURNS [success, terminateService, newPackage: BOOL, queueingCommands: LIST OF Rope.ROPE];
InitStats: PROC [myName: RPC.ShortROPE, myAddress: RPC.ShortROPE] ;
InitCommands: PROC [remoteCommandDirectory, localCommandDirectory: Rope.ROPE] RETURNS [msg: Rope.ROPENIL] ;
getNewPackages: PROC;
MyCatcher: RuntimeError.UCSProc;
SummonerServerMonitor: PROC;
ReportServerEvent: PROC [type: ComputeServerStatistics.ServerEventType, command: Rope.ROPE, startTime: BasicTime.GMT, endTime: BasicTime.GMT, remoteMachineName: Rope.ROPE];
END.