Programming ReferenceA migration is described in an extended Java language. A program in the extended language is translated into a program in the standard Java language by JavaGO compiler (jgoc). Then, a generated Java program can be compiled by any standard Java compiler. The extension introduces only three keywords go, undock and migratory. The migration in JavaGO is completely controlled by these three keywords. The go statementA migration is initiated by executing a go statement. A go statement takes a string as an input and may throw an exception.
void go( java.lang.String destination ) throws java.lang.Exception,
javago.NotifyGone;
The destination is designated by a URL. There are two kinds of destination URLs.
When a migration takes place, exception javago.NotifyGone is thrown. Since this exception is used to implement the JavaGO migration mechanism, it must not be blocked. Exception javago.NotifyGone is a subclass of Throwable. When a migration fails, an exception is thrown that notifies the reason of the failure. Error handling of a go statement can be written as follows.
try {
...
go ("jgp://flute:12002/test_place");
...
} catch (Exception err) {
...
}
A go statement must not be put in a constructor nor an initializer. In addition, a go statement must not be put in a non-migratory method provided that it is not enclosed within an undock statement. A go statement must not be put in the initialization part, the conditional part and the iteration part of a for statement. The undock statementA part of a thread that is moved on migration can be controlled by using an undock statement.
undock {
...
}
The migrated part is the inside area of an undock statement. When a go statement is within overlapped scopes of several undock statements, the migrated part is the innermost one. An undock statement blocks exception javago.NotifyGone, and throws exception java.lang.Exception. An undock statement must not be put in a constructor nor an initializer. The migratory method modifierA migration can take place in a method that is declared as migratory. public migratory void foo(); The method declared as migratory is called a migratory method. A migratory method can be called in a migratory method, but it must not be called in a non-migratory method unless it is not enclosed within an undock statement. A migratory method must no be called in the initialization part, the conditional part and the iteration part of a for statement. Thread Restoration from a FileTo restore a thread from a file, use the following library function.
public static void javago.StackFrame.Restore( String Path )
throws Exception;
The parameter is a path of the file. If some problems occur, an exception that notifies the reason of the failure is thrown. Points to Notice in Programming
|
|||||