org.omg.stub.java.rmi


1. Invoking a Remote Method with RMI

import org.omg.CORBA.ORB;
import org.omg.stub.java.rmi.Remote;
import org.omg.stub.java.rmi.RemoteStub;

public class Client {
    public static void main(String[] args) throws Exception {
        ORB orb = ORB.init(args, null);
        Remote obj = (Remote) orb.string_to_object("rmi://localhost:1099/Hello");
        String response = obj.invoke("sayHello", new Object[] {}, new String[] {});
        System.out.println(response);
    }
}

2. Implementing a Remote Object with RMI

import org.omg.CORBA.ORB;
import org.omg.stub.java.rmi.Remote;
import org.omg.stub.java.rmi.RemoteStub;

public class HelloImpl extends RemoteStub implements Hello {
    @Override
    public String sayHello() {
        return "Hello, world!";
    }
}

3. Passing Parameters to a Remote Method

4. Returning a Value from a Remote Method

5. Handling Exceptions in Remote Methods

6. Using an Interface to Define a Remote Object

7. Using a Remote Reference to Call a Remote Method

8. Creating a Remote Object Factory

9. Using a Remote Object Factory with Server-Side Activation

10. Creating a Remote Object Adapter

11. Using a Remote Object Adapter with Server-Side Activation

**12. Creating a Portable Remote Object (