|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.vub.at.actors.eventloops.EventLoop
edu.vub.at.actors.natives.ELActor
An instance of the class ELActor represents a programmer-defined AmbientTalk/2 actor. The event queue of the actor event loop serves as the actor's 'meta-level' queue. The events in the 'meta-level' queue are handled by the actor's mirror object. This mirror is normally an instance of NATActorMirror, but it can be any programmer-defined object that adheres to the ATActorMirror interface.
Nested Class Summary |
Nested classes inherited from class edu.vub.at.actors.eventloops.EventLoop |
EventLoop.EventProcessor |
Field Summary | |
private ATObject |
behaviour_
|
protected ELVirtualMachine |
host_
|
private ATActorMirror |
mirror_
|
protected ReceptionistsSet |
receptionists_
|
Fields inherited from class edu.vub.at.actors.eventloops.EventLoop |
eventQueue_, processor_ |
Constructor Summary | |
|
ELActor(ATActorMirror mirror,
ELVirtualMachine host)
|
protected |
ELActor(ELVirtualMachine host)
constructor dedicated to initialization of discovery actor |
Method Summary | |
static ELActor |
currentActor()
|
void |
event_accept(Packet serializedMessage)
The main entry point for any asynchronous messages sent to this actor by external sources (e.g. the VM or other local actors). |
void |
event_acceptSelfSend(ATAsyncMessage msg)
The main entry point for any asynchronous self-sends. |
protected void |
event_init(BlockingFuture future,
Packet parametersPkt,
Packet initcodePkt)
The initial event sent by the actor mirror to its event loop to intialize itself. |
void |
event_serviceJoined(Packet requiredStripePkt,
ATFarReference myHandler,
Packet discoveredStripePkt,
Packet remoteServicePkt)
When the discovery manager receives a publication from another local actor or another remote VM, the actor is asked to compare the incoming publication against a subscription that it had announced previously. |
NATLocalFarRef |
export(ATObject object)
Export the given local object such that it is now remotely accessible via the returned object id. |
ATActorMirror |
getActorMirror()
|
ELVirtualMachine |
getHost()
|
void |
handle(Event event)
Actor event loops handle events by allowing the meta-level events to process themselves. |
protected void |
initRootObject()
Initialises the root using the contents of the init file stored by the hosting virtual machine. |
protected void |
initSharedFields()
Initialises various fields in the lexical root of the actor, which are defined in the context of every actor. |
ATObject |
resolve(ATObjectID id,
ATStripe[] stripes)
Resolve the given object id into a local reference. |
void |
setActorMirror(ATActorMirror mirror)
|
ATObject |
sync_event_eval(ATAbstractGrammar ast)
This method should only be used for purposes such as the IAT shell or unit testing. |
java.lang.Object |
sync_event_performTest(Callable c)
This method should only be used for purposes of unit testing. |
java.lang.Object |
sync_event_symbioticInvocation(Callable invocation)
This method is invoked by a coercer in order to schedule a symbiotic invocation from the Java world, which should be synchronous to the Java thread, but which must be scheduled asynchronously to comply with the AT/2 actor model. |
Methods inherited from class edu.vub.at.actors.eventloops.EventLoop |
currentEventLoop, execute, owner, receive, receiveAndWait, receivePrioritized, stopProcessing, toEventLoop, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private ATActorMirror mirror_
protected final ELVirtualMachine host_
protected final ReceptionistsSet receptionists_
private ATObject behaviour_
Constructor Detail |
public ELActor(ATActorMirror mirror, ELVirtualMachine host)
protected ELActor(ELVirtualMachine host)
Method Detail |
public static final ELActor currentActor()
public void handle(Event event)
handle
in class EventLoop
event
- the event object which was dequeued and which should be processedpublic ATActorMirror getActorMirror()
public void setActorMirror(ATActorMirror mirror)
public ELVirtualMachine getHost()
public NATLocalFarRef export(ATObject object) throws InterpreterException
object
- a **near** reference to the object to export
XIllegalOperation
- if the passed object is a far reference, i.e. non-local
InterpreterException
public ATObject resolve(ATObjectID id, ATStripe[] stripes)
id
- the identifier of the object to resolve
protected void initRootObject() throws InterpreterException
InterpreterException
protected void initSharedFields() throws InterpreterException
InterpreterException
- when initialisation of a field failsprotected void event_init(BlockingFuture future, Packet parametersPkt, Packet initcodePkt)
future
- the synchronization point with the creating actor, needs to be fulfilled with a far ref to the behaviour.parametersPkt
- the serialized parameters for the initialization codeinitcodePkt
- the serialized initialization codepublic void event_acceptSelfSend(ATAsyncMessage msg)
public void event_accept(Packet serializedMessage)
public java.lang.Object sync_event_symbioticInvocation(Callable invocation) throws java.lang.Exception
invocation
- a functor object that will perform the symbiotic invocation
java.lang.Exception
- if the symbiotic invocation failspublic ATObject sync_event_eval(ATAbstractGrammar ast) throws InterpreterException
ast
- an abstract syntax tree to be evaluated by the receiving actor (in the
scope of its behaviour).
InterpreterException
- if the evaluation failspublic java.lang.Object sync_event_performTest(Callable c) throws java.lang.Exception
java.lang.Exception
public void event_serviceJoined(Packet requiredStripePkt, ATFarReference myHandler, Packet discoveredStripePkt, Packet remoteServicePkt)
myHandler
- the closure specified as a handler for the actor's subscription
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |