next up previous contents
Next: Migration Up: WWC Implementation in SALSA Previous: Universal Actor Creation

Referencing actors

Actor references can be used as the target of message sending expressions or as arguments of messages. There are three ways to get an actor reference. Two of them, the return value of actor creation and references from messages, are available in both distributed and concurrent SALSA programming. The last one, getReferenceByName(), is an explicit approach that translates a string representing a UAN into a reference. In SALSA, only references to service actors (see Section 4.2.4) should be obtained using this function. Otherwise, SALSA does not guarantee the safety property of actor garbage collection, which means one can get a phantom reference (a reference pointing to nothing). The way to get a reference by getReferenceByName() is shown as follows:
 
AddressBook remoteService= (AddressBook) 
  AddressBook.getReferenceByName("uan://nameserver1/id");
 
   
Sometimes an actor wants to know its name or location. An actor can get its UAL (location) by the function getUAL() and UAN (universal name) by getUAN(). For example:
 
UAL selfUAL= this.getUAL();
UAN selfUAN = this.getUAN();
 
   


Wei-Jen Wang
2007-11-28