Information Technology Reference
In-Depth Information
service ClockService {
recovery Error (RemoteException e) {
MulticastClient client = new MulticastClient();
String[] s = new String[1];
s[0] = client.getNextHost();
setHosts(s);
System.out.println( "Switching to: " + s[0]);
}
protocol :rmi{
options {
registryName = "RMITestServer" ;
registryHost = "localhost" ;
registryPort = 1099;
hosts = "localhost,bookworm,bookpro" ;
runEmbeddedRegistry = true;
serverPlugin = "uk.ac.glam.recovery.MulticastServer" ;
}
pointcut Date ClockDate.getDate () {
recovery = Error;
}
}
}
Figure 6.17.
RMI ClockService DDL for multicast recovery.
remoteJ.multicast.group. The multicast group address.
remoteJ.multicast.ttl. The time-to-live value. This value is used by
routers to decide whether to pass the multicast datagram on to a destination
network or not.
Our DDL, illustrated in Figure 6.17, sets the server plugin to our simple
multicast server and uses a user-defined class, MulticastClient , in the recovery
routine.
In the event of an error, the recovery routine creates an instance of the
MulticastClient class and calls its getNextHost() method, which broadcasts a
message on the network and waits for a response from a server process. Upon
receipt of a response, the client sets the current host to the responding server's
address and execution continues.
This recovery scenario and the interaction between client and server is illus-
trated in Figure 6.16.
Search WWH ::




Custom Search