Information Technology Reference
In-Depth Information
import java.rmi.∗;
import clock.∗;
service ClockService {
recovery Error (RemoteException e) {
System.out.println( "Method: " + transfer.getMethod());
System.out.println( "Host : " + transfer.getCurrentHost());
String[] s = new String[2];
s[0] = "hosts1" ;
s[1] = "hosts2" ;
setHosts(s);
System.out.println( "Switching to alternate hosts" );
}
protocol :rmi{
options {
registryName = "RMITestServer" ;
registryHost = "localhost" ;
registryPort = 1099;
runEmbeddedRegistry = true;
}
pointcut Date ClockDate.getDate () {
recovery = Error;
}
}
}
Figure 5.6.
RMI ClockService DDL.
Client generation phase. Matching classes and associated methods defined in the
DDL are altered to call an RMI server.
Server bootstrap. A simple RMI server main class is generated and matching
classes and methods referred to in the DDL are exported as RMI remote
objects. Optionally, an RMI Registry is created to hold references to the
exported objects.
Each phase of the implementation is described in detail below.
5.4.2
RMI Interface Generation Phase
In order to generate the interfaces, a list of classes that match the classes referred
to in the DDL is generated. For example the DDL statement:
pointcut ∗ Address.∗ (String, String)
results in a list of all public methods defined in the Address class having any
return type and two parameters of type String . Once a list of matching meth-
ods has been collected, they are evaluated to ensure they adhere to the RMI-
Search WWH ::




Custom Search