|
|||||||||||
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.NATByRef
edu.vub.at.actors.natives.NATActorMirror
The NATActorMirror class implements the concurrency model of ambienttalk. It continually consumes meta-events which are written to a synchronized queue. This way the actor is notified of incoming messages, discovered and lost services, etc. When no meta- messages are available, the actor consumes base-level messages as they are stored in its inbox. These messages have a receiver object internal to the actor and they will be invoked on this receiver by the actor's thread.
Nested Class Summary | |
static class |
NATActorMirror.NATProtocol
A protocol object is defined as: object: { def installedMirror := //the installed actor mirror; def uninstall() { //uninstall the protocol object } } |
static class |
NATActorMirror.NATPublication
A publication object is defined as: object: { def topic := //topic under which service is published; def service := //the exported service object; def cancel() { //unexport the service object } } |
static class |
NATActorMirror.NATSubscription
A subscription object is defined as: object: { def topic := //topic subscribed to; def handler := //the closure to be triggered; def cancel() { //unsubscribe the handler } } |
Field Summary | |
private ELDiscoveryActor |
discoveryActor_
|
Fields inherited from class edu.vub.at.objects.natives.NATNil |
_INSTANCE_ |
Fields inherited from interface edu.vub.at.actors.ATActorMirror |
_IN_, _OUT_, _PROVIDED_, _REQUIRED_ |
Constructor Summary | |
NATActorMirror(ELVirtualMachine host)
When initializing a new actor, do not forget that this constructor is still executed by the creating actor, not by the created actor. |
Method Summary | |
ATActorMirror |
base_asActorMirror()
|
ATAsyncMessage |
base_createMessage(ATObject sender,
ATSymbol selector,
ATTable arguments)
Creates a first-class message in the language. |
ATObject |
base_install_(ATClosure code)
def install: { code } |
ATObject |
base_provide(ATStripe topic,
ATObject service)
This mechanism is the most basic mechanism to provide a service. |
ATObject |
base_require(ATStripe topic,
ATClosure handler,
ATBoolean isPermanent)
This mechanism is the most basic mechanism to require a service. |
ATObject |
base_send(ATAsyncMessage message)
When default base-level objects send an asynchronous message, they delegate this responsibility to their actor by means of this base-level method. |
static NATLocalFarRef |
createActor(ELVirtualMachine host,
Packet parametersPkt,
Packet initcodePkt,
ATActorMirror actorMirror)
Creates a new actor on the specified host Virtual Machine. |
static NATLocalFarRef |
createEmptyActor(ELVirtualMachine host,
ATActorMirror actorMirror)
Auxiliary creation method to create an actor with an empty behaviour. |
ATObject |
meta_clone()
Clone the receiver object. |
ATTable |
meta_getStripes()
Returns the stripes of this object. |
ATObject |
meta_newInstance(ATTable initargs)
actor.new(closure) => same effect as evaluating 'actor: closure' |
NATText |
meta_print()
Prints out the object in a human-readable way. |
ATObject |
meta_receive(ATAsyncMessage msg)
Handles a first-class message of which it is the receiver. |
ATObject |
meta_send(ATAsyncMessage msg)
To send a message msg to a receiver object rcv: - if rcv is a local reference, schedule accept(msg) in my incoming event queue - if rcv is a far reference, schedule msg in far reference's outbox |
Methods inherited from class edu.vub.at.objects.natives.NATByRef |
meta_pass, meta_resolve |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface edu.vub.at.objects.ATObject |
base__opeql__opeql_, base_init, base_new, meta_addField, meta_addMethod, meta_assignField, meta_assignVariable, meta_defineField, meta_doesNotUnderstand, meta_eval, meta_extend, meta_getDynamicParent, meta_getLexicalParent, meta_grabField, meta_grabMethod, meta_invoke, meta_isCloneOf, meta_isRelatedTo, meta_isStripedWith, meta_listFields, meta_listMethods, meta_lookup, meta_pass, meta_quote, meta_resolve, meta_respondsTo, meta_select, meta_share |
Field Detail |
private final ELDiscoveryActor discoveryActor_
Constructor Detail |
public NATActorMirror(ELVirtualMachine host)
Method Detail |
public static NATLocalFarRef createActor(ELVirtualMachine host, Packet parametersPkt, Packet initcodePkt, ATActorMirror actorMirror) throws InterpreterException
host
- the VM hosting this actor - after creation, the actor registers itself with this VMparametersPkt
- the serialized parameters used to invoke the initialization codeinitcodePkt
- the serialized initialization code used to initialize the actor behaviouractorMirror
- this actor's mirror
InterpreterException
public static NATLocalFarRef createEmptyActor(ELVirtualMachine host, ATActorMirror actorMirror) throws InterpreterException
InterpreterException
public ATAsyncMessage base_createMessage(ATObject sender, ATSymbol selector, ATTable arguments) throws InterpreterException
ATActorMirror
base_createMessage
in interface ATActorMirror
InterpreterException
public ATObject base_provide(ATStripe topic, ATObject service) throws InterpreterException
ATActorMirror
base_provide
in interface ATActorMirror
InterpreterException
public ATObject base_require(ATStripe topic, ATClosure handler, ATBoolean isPermanent) throws InterpreterException
ATActorMirror
base_require
in interface ATActorMirror
isPermanent
- - if true, the subscription is permanent, if false, once the subscription
has been satisfied, it is automatically cancelled.
InterpreterException
public ATObject meta_clone() throws InterpreterException
ATObject
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 NATText meta_print() throws InterpreterException
ATObject
meta_print
in interface ATObject
meta_print
in class NATNil
InterpreterException
public ATObject meta_send(ATAsyncMessage msg) throws InterpreterException
meta_send
in interface ATObject
meta_send
in class NATNil
InterpreterException
public ATObject meta_receive(ATAsyncMessage msg) throws InterpreterException
ATObject
meta_receive
in interface ATObject
meta_receive
in class NATNil
InterpreterException
public ATTable meta_getStripes() throws InterpreterException
ATObject
meta_getStripes
in interface ATObject
meta_getStripes
in class NATNil
InterpreterException
public ATObject base_send(ATAsyncMessage message) throws InterpreterException
base_send
in interface ATActorMirror
InterpreterException
public ATObject base_install_(ATClosure code) throws InterpreterException
base_install_
in interface ATActorMirror
code
- meta-level code that overrides an actor's MOP methods
InterpreterException
Technically, this MOP installation is achieved by performing an
imperative mixin operation on the actor's mirror.
public ATActorMirror base_asActorMirror() throws XTypeMismatch
base_asActorMirror
in interface ATConversions
base_asActorMirror
in class NATNil
XTypeMismatch
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |