javax.rmi


1. Creating an RMI Server

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

public class RMIServer {
    public static void main(String[] args) {
        try {
            // Create a remote object
            RemoteObjectImpl remoteObject = new RemoteObjectImpl();

            // Export the remote object
            RemoteObject stub = (RemoteObject) UnicastRemoteObject.exportObject(remoteObject, 0);

            // Create a registry
            Registry registry = LocateRegistry.createRegistry(1099);

            // Register the remote object with the registry
            registry.bind("RemoteObject", stub);

            System.out.println("Server running...");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

2. Creating an RMI Client

3. Passing Arguments to RMI Methods

4. Handling Exceptions in RMI

5. Using RMI with JNDI

6. Using RMI with SSL

7. Using RMI with CORBA

8. Using RMI with SOAP

9. Using RMI with REST

10. Using RMI withAnnotations