June 2017
Intermediate to advanced
304 pages
7h 12m
English
The server program used to perform the calculation is relatively simple compared to the client program, which needs to handle the RMI along with computation calls.
In our example, the client program communicates with the remote program through the remote application naming invocation and by calling the remote interface methods:
package local;import java.net.MalformedURLException;import java.rmi.Naming;import java.rmi.NotBoundException;import java.rmi.RemoteException;import remote.Calculate;public class CalculateClient { public static void main(String[] args) { try { Calculate remoteCalculate = (Calculate) Naming.lookup("rmi://localhost:5000/calculate"); System.out.println("Remote Addition Result : " + remoteCalculate.add(4, ...Read now
Unlock full access