edu.vub.at.actors.natives
Class SharedActorField

java.lang.Object
  extended byedu.vub.at.actors.natives.SharedActorField
Direct Known Subclasses:
SAFLobby, SAFSystem, SAFWorkingDirectory

public abstract class SharedActorField
extends java.lang.Object

SharedActorField is a class which is used to allow introducing additional fields into the lexical scope of every actor. They are passed at startup to the virtual machine and every actor will initialize them during the processing of its event_init. Note that actors should never share objects, which is why this class does not store a value but rather has an abstract initialize method in which a new object can be created.

Author:
smostinc

Field Summary
private  ATSymbol name_
           
 
Constructor Summary
SharedActorField(ATSymbol name)
           
 
Method Summary
 ATSymbol getName()
           
abstract  ATObject initialize()
          Hook to be overridden in order to initialize the field which should be installed in every actor's lexical root object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name_

private final ATSymbol name_
Constructor Detail

SharedActorField

public SharedActorField(ATSymbol name)
Method Detail

getName

public ATSymbol getName()

initialize

public abstract ATObject initialize()
                             throws InterpreterException
Hook to be overridden in order to initialize the field which should be installed in every actor's lexical root object. The method is executed by the thread of the newly created actor, which can thus be accessed using ELActor.currentActor(). NOTE: if the return value is null, the field will not be added to the lexical root.

Returns:
the object to be assigned to the field with the specified name in the current actor's lexical root
Throws:
InterpreterException