Oberon ||
Library ||
Module Index ||
Search Engine ||
Definition ||
Module
Ulm's Oberon Library:
Shadows
NAME
Shadows - call-back objects on top of RemoteObjects
SYNOPSIS
TYPE Shadow = POINTER TO ShadowRec;
TYPE ShadowRec = RECORD (Services.ObjectRec) END;
PROCEDURE InitObject(object: Services.Object);
PROCEDURE Create(VAR shadow: Shadow; proxy: Services.Object);
PROCEDURE Init(shadow: Shadow; proxy: Services.Object);
PROCEDURE Send(object: Services.Object; VAR message: Messages.Message);
PROCEDURE SendExcept(object: Services.Object; shadow: Shadow;
VAR message: Messages.Message);
PROCEDURE GetProxy(shadow: Shadow; VAR proxy: Services.Object);
PROCEDURE GetShadow(proxy: Services.Object; VAR shadow: Shadow);
DESCRIPTION
RemoteObjects
supports the delegation of operations from proxy objects to
their associated original object.
In some cases, it turns out to be necessary to delegate
operations from the side of the original object to all sides
with proxy objects.
Shadows
supports this on base of shadow objects.
Shadow objects are created on the side of the proxy object
and exported to the side of the original object.
Shadows
maintains a list of shadow proxies at the side of the original
object and allows operations to be forwarded to all (or nearly all)
shadow objects which, in turn, may operate on the proxy objects.
Shadows
must be supported by that module which installs its interface
at RemoteObjects:
- InitObject is to be called by the
RemoteObjects.GetParamsProc interface procedure
to prepare an object to receive messages about newly created proxies
of it.
- Create is to be called by the
RemoteObjects.RegisterProc interface procedure
to register a proxy object at the side of the original object.
Init may be used instead of Create if an extension
of Shadows.Shadow is used.
Note that shadow objects depend on their associated proxy objects
and hence terminate when their proxy object terminates
(see Resources).
Send sends the given message to all shadow objects
of the given object.
This is a no-operation if the given object is not shadowed.
Note that Shadows parallelizes the forwarding of
messages to all shadow objects by maintaining a
task for each shadow proxy.
SendExcept works like Send but suppresses
the delivery of the message to the given shadow object.
This allows to forward a message which came from one of
the shadow objects to all other shadow objects.
GetProxy
allows (on the side of the proxy object) to retrieve the
associated proxy object of a shadow.
This is useful for message handlers of shadow objects.
GetShadow
returns the shadow of a proxy object.
This may be useful for other parties which are interested
in installing a message handler for the shadow object.
DIAGNOSTICS
Shadows does not generate any error events on its own
but forwards the events of Messages to the associated objects.
Send and SendExcept silently ignore the message
if the given object is not shadowed.
GetProxy and GetShadow return NIL
in error cases (if it is called on the wrong side or
if that object is not shadowed).
SEE ALSO
- Message
-
message handling
- RemoteObjects
-
delegation of messages to remote objects
- Resources
-
life-time dependencies between objects
Edited by: borchert, last change: 1995/12/19, revision: 1.1, converted to HTML: 1997/04/28
Oberon ||
Library ||
Module Index ||
Search Engine ||
Definition ||
Module