|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.vub.at.objects.natives.NATNil
edu.vub.at.objects.natives.NATByCopy
edu.vub.at.objects.mirrors.OBJMirrorRoot
OBJMirrorRoot is a singleton which is shared by as a parent by all NATIntercessiveMirrors, It encodes the default behaviour to deal with invocation, selection and field assignment along the dynamic parent chain. This behaviour can be extracted, since these operations are always parameterised by a receiver object, namely the intercessive mirror in question.
Field Summary | |
static OBJMirrorRoot |
_INSTANCE_
|
static ATSymbol |
_MIRROR_
|
Constructor Summary | |
private |
OBJMirrorRoot()
|
Method Summary | |
protected ATObject |
createChild(ATClosure code,
boolean parentPointerType)
|
ATNil |
meta_assignField(ATObject receiver,
ATSymbol name,
ATObject value)
The effect of assigning a field on a mirror can be twofold. |
ATObject |
meta_clone()
OBJMirrorRoot is a singleton object. |
ATTable |
meta_getStripes()
By default, a native object (and also nil) has no stripes. |
ATObject |
meta_invoke(ATObject receiver,
ATSymbol atSelector,
ATTable arguments)
The effect of invoking methods on a mirror (through meta_invoke) consists of checking whether the requested functionality is provided as a meta-operation by the principal that is wrapped by this mirror. |
ATObject |
meta_resolve()
After deserialization, ensure that the mirror root remains unique. |
ATObject |
meta_select(ATObject receiver,
ATSymbol atSelector)
The effect of selecting fields or methods on a mirror (through meta_select) consists of checking whether the requested selector matches a field of the principal wrapped by this mirror. |
Methods inherited from class edu.vub.at.objects.natives.NATByCopy |
meta_pass |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final ATSymbol _MIRROR_
public static final OBJMirrorRoot _INSTANCE_
Constructor Detail |
private OBJMirrorRoot()
Method Detail |
public ATObject meta_invoke(ATObject receiver, ATSymbol atSelector, ATTable arguments) throws InterpreterException
The effect of invoking methods on a mirror (through meta_invoke) consists of checking whether the requested functionality is provided as a meta-operation by the principal that is wrapped by this mirror. Since such meta-operations are intercepted and forwarded to allow for interception, the mirage is expected to have a method for the given selector albeit prefixed with 'magic_'.
meta_invoke
in interface ATObject
meta_invoke
in class NATNil
InterpreterException
public ATObject meta_clone() throws InterpreterException
meta_clone
in interface ATObject
meta_clone
in class NATNil
InterpreterException
protected ATObject createChild(ATClosure code, boolean parentPointerType) throws InterpreterException
createChild
in class NATNil
InterpreterException
public ATObject meta_select(ATObject receiver, ATSymbol atSelector) throws InterpreterException
The effect of selecting fields or methods on a mirror (through meta_select) consists of checking whether the requested selector matches a field of the principal wrapped by this mirror. If this is the case, the principal's ('meta_get' + selector) method will be invoked. Else the selector might identify one of the principal's meta-operations. If this is the case, then an AmbientTalk representation of the Java method ('meta_' + selector) will be returned.
Because an explicit AmbientTalk method invocation must be converted into an implicit Java method invocation, the invocation must be deified ('upped'). To uphold stratification of the mirror architecture, the result of this operation should be a mirror on the result of the Java method invocation.
Note that only when the principal does not have a matching meta_level field or method the mirror itself will be tested for a corresponding base_level behaviour (e.g. for its base field or for operators such as ==). In the latter case, stratification is not enforced. This is due to the fact that the said fields and methods are not meta-level behaviour, rather they are base-level operations which happen to be applicable on a mirror. An added advantage of this technique is that it permits a mirror to have a field referring to its principal.
meta_select
in interface ATObject
meta_select
in class NATNil
InterpreterException
public ATNil meta_assignField(ATObject receiver, ATSymbol name, ATObject value) throws InterpreterException
meta_assignField
in interface ATObject
meta_assignField
in class NATNil
InterpreterException
public ATObject meta_resolve() throws InterpreterException
meta_resolve
in interface ATObject
meta_resolve
in class NATByCopy
InterpreterException
public ATTable meta_getStripes() throws InterpreterException
NATNil
meta_getStripes
in interface ATObject
meta_getStripes
in class NATNil
InterpreterException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |