next up previous contents
Next: Actors as Network Service Up: WWC Implementation in SALSA Previous: Referencing actors

Migration

As mentioned before, only universal actors can migrate. Sending the message migrate(<ual>) to an universal actor causes it to migrate seamlessly to the designated location. Its UAL will be changed and the naming service will be notified to update its entry.

The following example defines the behavior MigrateSelf, that migrates the MigrateSelf actor to location UAL1 and then to UAL2. The migrate message takes as argument a string specifying the target UAL or it can take the object new UAL("UAL string").
 
module examples;

behavior MigrateSelf { void act(String args[]){ if (args.length != 2) { standardOutput<-println( "Usage:" + "java -Duan=<UAN> examples.MigrateSelf <UAL1> <UAL2>"); return; } self<-migrate(args[0]) @ self<-migrate(args[1]); } }



Wei-Jen Wang
2007-11-28