Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
RobustObjects


NAME

RobustObjects - proxy objects which survive their original objects

SYNOPSIS

CONST typeGuardFailure = 0;
CONST notARobustObject = 1;
CONST errors = 2;
TYPE ErrorCode = SHORTINT;
TYPE ErrorEvent = POINTER TO ErrorEventRec;
TYPE ErrorEventRec =
   RECORD
      (Events.EventRec)
      errorcode: ErrorCode;
   END;
VAR error: Events.EventType;
VAR errormsg: ARRAY errors OF Events.Message;


PROCEDURE Export(object: Services.Object; status: Names.Status; path: ARRAY OF CHAR; auth: Shards.Lid; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE ExportR(object: Services.Object; status: Names.Status; root: Names.Node; path: ARRAY OF CHAR; auth: Shards.Lid; errors: RelatedEvents.Object) : BOOLEAN;

PROCEDURE Import(VAR object: Services.Object; path: ARRAY OF CHAR; auth: Shards.Lid; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE ImportR(VAR object: Services.Object; root: Names.Node; path: ARRAY OF CHAR; auth: Shards.Lid; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE GuardedImportR(VAR object: Services.Object; guard: Services.Type; root: Names.Node; path: ARRAY OF CHAR; auth: Shards.Lid; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE GuardedImport(VAR object: Services.Object; guard: Services.Type; path: ARRAY OF CHAR; auth: Shards.Lid; errors: RelatedEvents.Object) : BOOLEAN;

DESCRIPTION

By default, proxy objects of RemoteObjects terminate if the connection to their original object breaks down, or if the other side terminates. RobustObjects offers a mechanism (based on Names, PathConditions and some extension features of RemoteObjects) which allows to suspend the proxy object (instead of terminating it) in such cases until the original object is accessible again by the name service (see Names).

This mechanism requires the support of both sides:

The paths are interpreted as described by PathConditions and taken relatively to root (if ExportR, ImportR, or GuardedImportR is used). The authorization lid auth is used to access all components of the parts and passed to PathConditions. Export and ExportR pass status (just Names.examine and Names.change are to be given if non-NIL) to the equally named parameter of Names.CreateNode. Note that all operations block until the whole path becomes accessible (see PathConditions).

The suspension and reanimation of proxy objects is signalled by Resources: Resources.communicationStopped and Resources.communicationResumed. No operations are processed while the proxy object is suspended. The proxy object terminates if the recovery mechanism fails due to fatal errors.

Note that ``robust objects'' may be freely exported and imported by using RemoteObjects directly. But they get their special property only if Import, ImportR, GuardedImport, or GuardedImportR have been called on the exporting side and Export or ExportR on the importing side.

DIAGNOSTICS

RobustObjects relates error events to the error parameters, and, in case of recovery problems, to the proxy object. Following error events may be generated by RobustObjects itself:
typeGuardFailure
This error event is raised by GuardedImport and GuardedImportR if the given type guard fails.
notARobustObject
All import operations of RobustObjects will fail if the object has not been exported by Export or ExportR and generate this error event instead.

SEE ALSO

PathConditions
conditions which allow to wait until a path becomes valid
Names
name hierachies of objects which may be shared on the base of name servers
RemoteObjects
access of remote objects and interface for recovery mechanisms

BUGS

It is theoretically possible that on recovery an object is imported which was already imported before. In this case there will be two proxy objects pointing to the same original object. This problem can be avoided by the exporting side if it does not make the original object available before Export or ExportR is called.

Typing errors in path names may cause all operations to hang infinitively.


Edited by: borchert, last change: 2002/02/15, revision: 1.3, converted to HTML: 2002/02/15

Oberon || Library || Module Index || Search Engine || Definition || Module