Remote Method Invocation (RMI) Flashcards
What are the imports for the RMI interface?
import java.rmi.Remote;
import java.rmi.RemoteException;
Give the interface signature
public interface RemoteEcho extends Remote {
What exception is thrown by the interface stub
RemoteException
What are the imports for the RMI implementation class?
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
Give the RMI implementation class signature
class RemoteEchoServant extends UnicastRemoteObject implements RemoteEcho {
What is the comment / annotation on RMI implementation methods
@Override
What are the imports for the main class on the server side?
import java.rmi.registry.Registry;
import java.rmi.registry.LocateRegistry;
Give the first line of the try block on the server
RemoteEcho rei = new RemoteEchoServant();
What are the imports for the main class on the client side?
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
Give the statement to create the registry on the client
Registry reg = LocateRegistry.getRegistry(“localhost”, 1099);
Give the statement to create the service on the server
Registry reg = LocateRegistry.getRegistry(“localhost”, 1099);
Give the statement to find the service on the registry from the client
Registry reg = LocateRegistry.getRegistry(“localhost”, 1099);
Give the statement to bind the registry on the server
reg.rebind(“echoServer”, rei);
Give the statement to lookup the registry in the client
Object o = reg.lookup(“echoServer”);
Give the first line of the main class in the client
RemoteEcho rei = null;