Remote Method Invocation (RMI)
Example: Displaying Objects(Thermometers)
on Separate Machines Using RMI
For this purpose we need three components for each remotely callable
object. For our application, both the thermometer object and the
observer objects must call each other. We want the thermometer to execute
on one machine and each observer to execute on its own separate machine.
So we need to implement remote objects for both the thermometer and
the observer canvas. Thus we need two sets of three components for each.
They are:
- public interface Thermometer extends java.rmi.Remote
- public class ThermometerImpl extends UnicastRemoteObject
      implements Thermometer, java.io.Serializable
- public class ThermApplication implements java.lang.Runnable
and
- public interface ThermObserver extends java.rmi.Remote
- public class ThermObserverImpl extends Canvas implements ThermObserver
- public class ObserverAppl extends Frame