|
|||||||||||
| 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.actors.natives.NATFarReference
NATFarReference is the root of the native classes that represent native far references. The AmbientTalk/2 implementation distinguishes between two kinds of far references: local and remote far references. The former denote far references to objects hosted by actors on the same virtual machine. The latter ones denote far references to remote objects that are hosted on a separate virtual (and usually even physical) machine. This abstract superclass encapsulates all of the code that these two kinds of far references have in common. The variabilities are delegated to the subclasses. Subclasses should implement an abstract method (transmit) which is invoked by this class when the far reference receives a message to be forwarded to the remote principal. Note that far references are pass by copy and resolve to either a near or a new actor-local far reference. Far references encapsulate the same stripes as the remote object they represent. As such it becomes possible to perform a stripe test on a far reference as if it was performed on the local object itself!
| Nested Class Summary | |
static class |
NATFarReference.NATDisconnectionSubscription
|
static class |
NATFarReference.NATReconnectionSubscription
|
| Field Summary | |
private ATObjectID |
objectId_
|
private ATStripe[] |
stripes_
|
| Fields inherited from class edu.vub.at.objects.natives.NATNil |
_INSTANCE_ |
| Constructor Summary | |
protected |
NATFarReference(ATObjectID objectId,
ATStripe[] stripes)
|
| Method Summary | |
NATFarReference |
asNativeFarReference()
|
ATFarReference |
base_asFarReference()
|
boolean |
base_isFarReference()
|
ATObjectID |
getObjectId()
|
ATNil |
meta_addField(ATField field)
Adds a field slot to an object at runtime. |
ATNil |
meta_addMethod(ATMethod method)
Adds a method slot to an object at runtime. |
ATNil |
meta_assignField(ATObject receiver,
ATSymbol name,
ATObject value)
Sets the value of a field to the given value. |
ATNil |
meta_assignVariable(ATSymbol name,
ATObject value)
Sets the value of the variable to the given value. |
ATObject |
meta_clone()
References to objects hosted by another actor are forced to be unique. |
ATNil |
meta_defineField(ATSymbol name,
ATObject value)
Defines a new field in an object. |
ATObject |
meta_doesNotUnderstand(ATSymbol selector)
Called when a selection fails because the selector was not found along the dynamic delegation hierarchy. |
ATObject |
meta_extend(ATClosure code)
TODO(discuss) Think about extending objects of another actor. |
ATObject |
meta_getDynamicParent()
Objects have a classical dynamic parent chain created using extension primitives. |
ATObject |
meta_getLexicalParent()
Objects also have a lexical parent which is the scope in which their definitions are nested. |
ATTable |
meta_getStripes()
The stripes of a far reference are the stripes of the remote object it points to, plus the FarReference stripe. |
ATField |
meta_grabField(ATSymbol fieldName)
Queries an object for one of its field slots. |
ATMethod |
meta_grabMethod(ATSymbol methodName)
Queries an object for one of its method slots. |
ATObject |
meta_invoke(ATObject receiver,
ATSymbol atSelector,
ATTable arguments)
Invoke a method corresponding to the selector with the given arguments. |
ATBoolean |
meta_isCloneOf(ATObject original)
Detects whether this object an the passed parameter are the result of cloning from a common ancestor (possibly either one of the objects itself). |
ATBoolean |
meta_isRelatedTo(ATObject object)
Detects whether both objects have a common origin, in other words whether they are related through a combination of the cloning and extension operators. |
ATTable |
meta_listFields()
Queries an object for a list of all of its field slots. |
ATTable |
meta_listMethods()
Queries an object for a list of all of its method slots. |
ATObject |
meta_lookup(ATSymbol selector)
Select a slot (field | method) from an object whose name corresponds to the given selector. |
ATObject |
meta_newInstance(ATTable initargs)
Cannot create a new instance using a farObject, this should be done either by sending rather than invoking new(args) such that the correct method is triggered or by invoking newInstance on a farMirror, which will send the call as well. |
NATText |
meta_print()
Prints out the object in a human-readable way. |
ATObject |
meta_receive(ATAsyncMessage message)
Handles a first-class message of which it is the receiver. |
ATObject |
meta_resolve()
After deserialization, ensure that only one unique remote reference exists for my target. |
ATBoolean |
meta_respondsTo(ATSymbol atSelector)
Query an object for a given field or method which is visible to the outside world. |
ATObject |
meta_select(ATObject receiver,
ATSymbol selector)
Select a slot (field | method) from an object whose name corresponds to the given selector. |
ATObject |
meta_share(ATClosure code)
TODO(discuss) Think about sharing objects of another actor. |
protected abstract ATObject |
transmit(ATAsyncMessage passedMessage)
|
| 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 |
| Methods inherited from interface edu.vub.at.actors.ATFarReference |
meta_retractUnsentMessages |
| Methods inherited from interface edu.vub.at.objects.ATObject |
base__opeql__opeql_, base_init, base_new, meta_eval, meta_isStripedWith, meta_pass, meta_quote, meta_send |
| Field Detail |
private final ATObjectID objectId_
private final ATStripe[] stripes_
| Constructor Detail |
protected NATFarReference(ATObjectID objectId,
ATStripe[] stripes)
| Method Detail |
public ATObjectID getObjectId()
public NATFarReference asNativeFarReference()
throws XTypeMismatch
asNativeFarReference in interface ATConversionsasNativeFarReference in class NATNilXTypeMismatch
public ATObject meta_resolve()
throws InterpreterException
meta_resolve in interface ATObjectmeta_resolve in class NATByCopyInterpreterException
public ATObject meta_receive(ATAsyncMessage message)
throws InterpreterException
ATObject
meta_receive in interface ATObjectmeta_receive in class NATNilInterpreterException
protected abstract ATObject transmit(ATAsyncMessage passedMessage)
throws InterpreterException
InterpreterException
public ATObject meta_invoke(ATObject receiver,
ATSymbol atSelector,
ATTable arguments)
throws InterpreterException
ATObject
meta_invoke in interface ATObjectmeta_invoke in class NATNilXIllegalOperation - Cannot synchronously invoke a method on a far reference
InterpreterException
public ATBoolean meta_respondsTo(ATSymbol atSelector)
throws InterpreterException
ATObject
meta_respondsTo in interface ATObjectmeta_respondsTo in class NATNilInterpreterException
public ATObject meta_doesNotUnderstand(ATSymbol selector)
throws InterpreterException
ATObject
meta_doesNotUnderstand in interface ATObjectmeta_doesNotUnderstand in class NATNilXSelectorNotFound - to ensure proper semantics should the interpreter be
extended such that it allows extending a far reference in the future.
InterpreterException
public ATObject meta_clone()
throws InterpreterException
meta_clone in interface ATObjectmeta_clone in class NATNilInterpreterException
public ATObject meta_newInstance(ATTable initargs)
throws InterpreterException
meta_newInstance in interface ATObjectmeta_newInstance in class NATNilInterpreterException
public ATObject meta_extend(ATClosure code)
throws InterpreterException
meta_extend in interface ATObjectmeta_extend in class NATNilInterpreterException
public ATObject meta_share(ATClosure code)
throws InterpreterException
meta_share in interface ATObjectmeta_share in class NATNilInterpreterException
public ATObject meta_select(ATObject receiver,
ATSymbol selector)
throws InterpreterException
ATObject
meta_select in interface ATObjectmeta_select in class NATNilXIllegalOperation - - cannot select in objects hosted by another actor.
InterpreterException
public ATObject meta_lookup(ATSymbol selector)
throws InterpreterException
ATObject
meta_lookup in interface ATObjectmeta_lookup in class NATNilXIllegalOperation - - cannot lookup in objects hosted by another actor.
InterpreterException
public ATNil meta_defineField(ATSymbol name,
ATObject value)
throws InterpreterException
ATObject
meta_defineField in interface ATObjectmeta_defineField in class NATNilXIllegalOperation - - cannot define in objects hosted by another actor.
InterpreterException
public ATNil meta_assignField(ATObject receiver,
ATSymbol name,
ATObject value)
throws InterpreterException
ATObject
meta_assignField in interface ATObjectmeta_assignField in class NATNilXIllegalOperation - - cannot assign in objects hosted by another actor.
InterpreterException
public ATNil meta_assignVariable(ATSymbol name,
ATObject value)
throws InterpreterException
ATObject
meta_assignVariable in interface ATObjectmeta_assignVariable in class NATNilXIllegalOperation - - cannot assign in objects hosted by another actor.
InterpreterException
public ATBoolean meta_isCloneOf(ATObject original)
throws InterpreterException
ATObject
meta_isCloneOf in interface ATObjectmeta_isCloneOf in class NATNilInterpreterException
public ATBoolean meta_isRelatedTo(ATObject object)
throws InterpreterException
ATObject
meta_isRelatedTo in interface ATObjectmeta_isRelatedTo in class NATNilInterpreterException
public ATNil meta_addField(ATField field)
throws InterpreterException
ATObject
meta_addField in interface ATObjectmeta_addField in class NATNilXIllegalOperation - - cannot add fields to an object in another actor.
InterpreterException
public ATNil meta_addMethod(ATMethod method)
throws InterpreterException
ATObject
meta_addMethod in interface ATObjectmeta_addMethod in class NATNilXIllegalOperation - - cannot add methods to an object in another actor.
InterpreterException
public ATField meta_grabField(ATSymbol fieldName)
throws InterpreterException
ATObject
meta_grabField in interface ATObjectmeta_grabField in class NATNilXSelectorNotFound - - as the far object has no fields of its own
InterpreterException
public ATMethod meta_grabMethod(ATSymbol methodName)
throws InterpreterException
ATObject
meta_grabMethod in interface ATObjectmeta_grabMethod in class NATNilXSelectorNotFound - otherwise
InterpreterException
public ATTable meta_listFields()
throws InterpreterException
ATObject
meta_listFields in interface ATObjectmeta_listFields in class NATNilInterpreterException
public ATTable meta_listMethods()
throws InterpreterException
ATObject
meta_listMethods in interface ATObjectmeta_listMethods in class NATNilInterpreterException
public NATText meta_print()
throws InterpreterException
ATObject
meta_print in interface ATObjectmeta_print in class NATNilInterpreterException
public ATObject meta_getDynamicParent()
throws InterpreterException
ATObject
meta_getDynamicParent in interface ATObjectmeta_getDynamicParent in class NATNilInterpreterException
public ATObject meta_getLexicalParent()
throws InterpreterException
ATObject
meta_getLexicalParent in interface ATObjectmeta_getLexicalParent in class NATNilInterpreterException
public ATTable meta_getStripes()
throws InterpreterException
meta_getStripes in interface ATObjectmeta_getStripes in class NATNilInterpreterExceptionpublic boolean base_isFarReference()
base_isFarReference in interface ATConversionsbase_isFarReference in class NATNil
public ATFarReference base_asFarReference()
throws XTypeMismatch
base_asFarReference in interface ATConversionsbase_asFarReference in class NATNilXTypeMismatch
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||