next up previous
Next: Implementation of Customized Language Up: The Meta-Level Architecture Previous: Reflective Annotation

Extensions via Meta-Objects

A meta-object is a meta-level representation of a base-level object. Its definition is similar to the ones in ABCL/R[18] and ABCL/R2[7,8]. Meta-objects are instances of class metaobject. Customized meta-objects can be defined by inheriting this class. Followings are the instance variables in the class metaobject, which have implementation-level information of an object:
namemeaning
class 13#13
state-vars 14#14
message-queue 15#15
evaluator 16#16
The methods of the class metaobject define how a method invocation on a base-level object is processed. The method invocation mechanism including mutual exclusion, method dispatches, etc., can be modified by defining customized methods. The followings are their protocols:
(message m):
When a method of an object is invoked, this method of the corresponding meta-object is invoked. Since multiple method invocations on an object are mutually excluded, this method first checks whether the invocation should be suspended. If so, it then puts the message into the message-queue; otherwise, it calls method accept.
(accept m):
When a meta-object decides to process a base-level method invocation, this method is called. In the method, an appropriate method definition to the message m is selected, and evaluated by calling a method eval-entry of its evaluator object.
(become env):
When the execution of a base-level method finishes, this method is called at the meta-level. The parameter env has values of base-level instance variables, which may have been updated during the execution. The meta-object copies these updated values from env in its instance variable state-vars. Subsequently, the method process-next will be called.
(process-next):
This method checks the message-queue. If there is any pending message waiting for acceptance, it will be removed from the queue, and subsequently processed by the method accept.

next up previous
Next: Implementation of Customized Language Up: The Meta-Level Architecture Previous: Reflective Annotation
Matt Hurlbut
1998-07-14