next up previous
Next: Syntax Up: Object Replication Previous: Object Replication

Mechanism

Since the meta-object of an object contains enough information to create a replica, the replication mechanism is implemented as a method of the class metaobject. First, we define two subclasses of metaobject: a class replicatable for objects that can create their replicas, and a class replica-meta for replicated objects. A method copy-object creates a replica on a specified processor (p), which is defined as follows:
;;; metaobjects of objects that can create replicas
(defclass replicatable (metaobject))

;;; metaobjects of replicated objects
(defclass replica-meta (metaobject)
(original)) ; additional instance variable

;;; creation of a replica of an object
(defmethod replicatable
copy-object (p &reply-to r)
(future
(make-replica-meta
:class class :state-vars state-vars
:evaluator evaluator :original self)
:on p :reply-to r))



In addition, policies for maintaining consistency between an original
object and replicas can be controlled. For example,
one might want to allow method invocations to an original object while it
has replicas.
Such a control can be programmed by overriding the methods
message
and accept of the class replicatable.

;;; metaobjects of objects that can create replicas (defclass replicatable (metaobject)) ;;; metaobjects of replicated objects (defclass replica-meta (metaobject) (original)) ; additional instance variable ;;; creation of a replica of an object (defmethod replicatable copy-object (p &reply-to r) (future (make-replica-meta :class class :state-vars state-vars :evaluator evaluator :original self) :on p :reply-to r)) In addition, policies for maintaining consistency between an original object and replicas can be controlled. For example, one might want to allow method invocations to an original object while it has replicas. Such a control can be programmed by overriding the methods message and accept of the class replicatable.
next up previous
Next: Syntax Up: Object Replication Previous: Object Replication
Matt Hurlbut
1998-07-14