|
|||||||||||
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.ELVirtualMachine
A ELVirtualMachine represents a virtual machine which hosts several actors. The virtual machine is in charge of creating connections with other virtual machines and orchestrates the broadcasting of its presence, the exchange of service descriptions and messages. It also contains a set of runtime parameters (such as the objectpath and initfile) which are needed to initialise a new actor. TODO: use pure JChannel to send pure async messages rather than using a MessageDispatcher? Or use dispatcher only for message transmission. TODO: urgently clean up the vm address book: race conditions exist wher ELFarRefs query the address book when there is no entry for the remote VM's address
Nested Class Summary |
Nested classes inherited from class edu.vub.at.actors.eventloops.EventLoop |
EventLoop.EventProcessor |
Field Summary | |
private static java.lang.String |
_GROUP_NAME_
the name of the multicast group joined by all AmbientTalk VMs |
ELDiscoveryActor |
discoveryActor_
|
private ATAbstractGrammar |
initialisationCode_
startup parameter to the VM: the code of the init.at file to use |
private java.util.Hashtable |
localActors_
a table mapping actor IDs to local native actors (int -> ELActor) |
MembershipNotifier |
membershipNotifier_
the JGroups discovery bus for this Virtual Machine |
org.jgroups.blocks.MessageDispatcher |
messageDispatcher_
the JGroups communication bus for this Virtual Machine |
private SharedActorField[] |
sharedFields_
startup parameter to the VM: the list of fields to be initialized in every hosted actor |
private org.jgroups.Address |
vmAddress_
the JGroups Address of the VM |
VMAddressBook |
vmAddressBook_
A table mapping VM GUIDs to Address objects. |
private GUID |
vmId_
the GUID of this VM |
Fields inherited from class edu.vub.at.actors.eventloops.EventLoop |
eventQueue_, processor_ |
Constructor Summary | |
ELVirtualMachine(ATAbstractGrammar initCode,
SharedActorField[] fields)
|
Method Summary | |
static ELVirtualMachine |
currentVM()
|
void |
event_actorCreated(ELActor actor)
Event that signals the creation of a new actor on this virtual machine. |
void |
event_goOffline()
Signals that this VM must disconnect from the underlying network channel |
void |
event_goOnline()
Signals that this VM can connect to the underlying network channel and can start distributed interaction. |
void |
event_memberJoined(org.jgroups.Address remoteVMAddress)
Notifies the discovery manager that a VM has joined the network. |
void |
event_memberLeft(org.jgroups.Address virtualMachine)
|
ELActor |
getActor(int id)
|
SharedActorField[] |
getFieldsToInitialize()
|
GUID |
getGUID()
|
ELVirtualMachine |
getHost()
|
ATAbstractGrammar |
getInitialisationCode()
|
org.jgroups.Address |
getLocalVMAddress()
|
void |
handle(Event event)
An event loop handles events by dispatching to the event itself. |
java.lang.Object |
handle(org.jgroups.Message message)
|
private void |
initializeNetwork()
|
void |
memberJoined(org.jgroups.Address virtualMachine)
|
void |
memberLeft(org.jgroups.Address virtualMachine)
|
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 static final java.lang.String _GROUP_NAME_
private final ATAbstractGrammar initialisationCode_
private final SharedActorField[] sharedFields_
private final GUID vmId_
private org.jgroups.Address vmAddress_
public final VMAddressBook vmAddressBook_
private final java.util.Hashtable localActors_
public org.jgroups.blocks.MessageDispatcher messageDispatcher_
public MembershipNotifier membershipNotifier_
public final ELDiscoveryActor discoveryActor_
Constructor Detail |
public ELVirtualMachine(ATAbstractGrammar initCode, SharedActorField[] fields)
Method Detail |
public static final ELVirtualMachine currentVM()
public GUID getGUID()
public ATAbstractGrammar getInitialisationCode()
public SharedActorField[] getFieldsToInitialize()
public ELVirtualMachine getHost()
public void handle(Event event)
handle
in class EventLoop
event
- the event object which was dequeued and which should be processedpublic ELActor getActor(int id)
public org.jgroups.Address getLocalVMAddress()
public void memberJoined(org.jgroups.Address virtualMachine)
memberJoined
in interface DiscoveryListener
public void memberLeft(org.jgroups.Address virtualMachine)
memberLeft
in interface DiscoveryListener
public void event_goOnline()
public void event_goOffline()
public void event_memberJoined(org.jgroups.Address remoteVMAddress)
public void event_memberLeft(org.jgroups.Address virtualMachine)
public void event_actorCreated(ELActor actor)
public java.lang.Object handle(org.jgroups.Message message)
handle
in interface org.jgroups.blocks.RequestHandler
private void initializeNetwork()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |