|
|||||||||||
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 ATConversions
asNativeFarReference
in class NATNil
XTypeMismatch
public ATObject meta_resolve() throws InterpreterException
meta_resolve
in interface ATObject
meta_resolve
in class NATByCopy
InterpreterException
public ATObject meta_receive(ATAsyncMessage message) throws InterpreterException
ATObject
meta_receive
in interface ATObject
meta_receive
in class NATNil
InterpreterException
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 ATObject
meta_invoke
in class NATNil
XIllegalOperation
- Cannot synchronously invoke a method on a far reference
InterpreterException
public ATBoolean meta_respondsTo(ATSymbol atSelector) throws InterpreterException
ATObject
meta_respondsTo
in interface ATObject
meta_respondsTo
in class NATNil
InterpreterException
public ATObject meta_doesNotUnderstand(ATSymbol selector) throws InterpreterException
ATObject
meta_doesNotUnderstand
in interface ATObject
meta_doesNotUnderstand
in class NATNil
XSelectorNotFound
- 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 ATObject
meta_clone
in class NATNil
InterpreterException
public ATObject meta_newInstance(ATTable initargs) throws InterpreterException
meta_newInstance
in interface ATObject
meta_newInstance
in class NATNil
InterpreterException
public ATObject meta_extend(ATClosure code) throws InterpreterException
meta_extend
in interface ATObject
meta_extend
in class NATNil
InterpreterException
public ATObject meta_share(ATClosure code) throws InterpreterException
meta_share
in interface ATObject
meta_share
in class NATNil
InterpreterException
public ATObject meta_select(ATObject receiver, ATSymbol selector) throws InterpreterException
ATObject
meta_select
in interface ATObject
meta_select
in class NATNil
XIllegalOperation
- - cannot select in objects hosted by another actor.
InterpreterException
public ATObject meta_lookup(ATSymbol selector) throws InterpreterException
ATObject
meta_lookup
in interface ATObject
meta_lookup
in class NATNil
XIllegalOperation
- - cannot lookup in objects hosted by another actor.
InterpreterException
public ATNil meta_defineField(ATSymbol name, ATObject value) throws InterpreterException
ATObject
meta_defineField
in interface ATObject
meta_defineField
in class NATNil
XIllegalOperation
- - 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 ATObject
meta_assignField
in class NATNil
XIllegalOperation
- - cannot assign in objects hosted by another actor.
InterpreterException
public ATNil meta_assignVariable(ATSymbol name, ATObject value) throws InterpreterException
ATObject
meta_assignVariable
in interface ATObject
meta_assignVariable
in class NATNil
XIllegalOperation
- - cannot assign in objects hosted by another actor.
InterpreterException
public ATBoolean meta_isCloneOf(ATObject original) throws InterpreterException
ATObject
meta_isCloneOf
in interface ATObject
meta_isCloneOf
in class NATNil
InterpreterException
public ATBoolean meta_isRelatedTo(ATObject object) throws InterpreterException
ATObject
meta_isRelatedTo
in interface ATObject
meta_isRelatedTo
in class NATNil
InterpreterException
public ATNil meta_addField(ATField field) throws InterpreterException
ATObject
meta_addField
in interface ATObject
meta_addField
in class NATNil
XIllegalOperation
- - cannot add fields to an object in another actor.
InterpreterException
public ATNil meta_addMethod(ATMethod method) throws InterpreterException
ATObject
meta_addMethod
in interface ATObject
meta_addMethod
in class NATNil
XIllegalOperation
- - cannot add methods to an object in another actor.
InterpreterException
public ATField meta_grabField(ATSymbol fieldName) throws InterpreterException
ATObject
meta_grabField
in interface ATObject
meta_grabField
in class NATNil
XSelectorNotFound
- - as the far object has no fields of its own
InterpreterException
public ATMethod meta_grabMethod(ATSymbol methodName) throws InterpreterException
ATObject
meta_grabMethod
in interface ATObject
meta_grabMethod
in class NATNil
XSelectorNotFound
- otherwise
InterpreterException
public ATTable meta_listFields() throws InterpreterException
ATObject
meta_listFields
in interface ATObject
meta_listFields
in class NATNil
InterpreterException
public ATTable meta_listMethods() throws InterpreterException
ATObject
meta_listMethods
in interface ATObject
meta_listMethods
in class NATNil
InterpreterException
public NATText meta_print() throws InterpreterException
ATObject
meta_print
in interface ATObject
meta_print
in class NATNil
InterpreterException
public ATObject meta_getDynamicParent() throws InterpreterException
ATObject
meta_getDynamicParent
in interface ATObject
meta_getDynamicParent
in class NATNil
InterpreterException
public ATObject meta_getLexicalParent() throws InterpreterException
ATObject
meta_getLexicalParent
in interface ATObject
meta_getLexicalParent
in class NATNil
InterpreterException
public ATTable meta_getStripes() throws InterpreterException
meta_getStripes
in interface ATObject
meta_getStripes
in class NATNil
InterpreterException
public boolean base_isFarReference()
base_isFarReference
in interface ATConversions
base_isFarReference
in class NATNil
public ATFarReference base_asFarReference() throws XTypeMismatch
base_asFarReference
in interface ATConversions
base_asFarReference
in class NATNil
XTypeMismatch
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |