2015-05-05 11:20:13 -07:00
|
|
|
//: remote/ptime/DisplayPerfectTime.java
|
|
|
|
// Uses remote object PerfectTime
|
|
|
|
// {RunByHand}
|
|
|
|
package remote.ptime;
|
2015-05-06 12:09:38 -07:00
|
|
|
import java.net.MalformedURLException;
|
2015-05-05 11:20:13 -07:00
|
|
|
import java.rmi.*;
|
|
|
|
import java.rmi.registry.*;
|
|
|
|
|
|
|
|
public class DisplayPerfectTime {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
System.setSecurityManager(new SecurityManager());
|
|
|
|
try {
|
|
|
|
PerfectTimeI t =
|
|
|
|
(PerfectTimeI)Naming.lookup(
|
|
|
|
"//MindviewToshibaLaptop:2005/PerfectTime");
|
|
|
|
for(int i = 0; i < 10; i++)
|
|
|
|
System.out.println("Perfect time = " +
|
|
|
|
t.getPerfectTime());
|
2015-05-06 12:09:38 -07:00
|
|
|
} catch(NotBoundException |
|
|
|
|
MalformedURLException |
|
|
|
|
RemoteException e) {
|
2015-05-05 11:20:13 -07:00
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} ///:~
|