next up previous contents
Next: Service Up: How SALSA Supports the Previous: Referencing actors   Contents

Migration

As mentioned before, only universal actors can migrate. Sending the message "migrate" to an universal actor causes it to migrate seamlessly to the designated location. Its UAL will be changed and the Naming server 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 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 2005-10-24