import java.rmi.*;
import java.rmi.server.*;
/* A remote object by J M Bishop Oct 1997
* =============== Java 1.2 August 2000
*
* These objects can be registered on one machine and
* accessed via the Internet and rmi protocol from other
* machines. Compilation is a two-step process:
* javac MagicNumber.java
* rmic MagicNumber
* The latter creates skeletons and stubs for the
* remote object. To make it accessible on the network:
* In Window 1 type:
* rmiregistry
* The registry will stay running.
* Then activate the server and client parts of the system.
*/
class MagicNumber extends UnicastRemoteObject implements Transferable {
MagicNumber () throws RemoteException {
}
public String getNumber () throws RemoteException {
return "Your magic number is "+ (int) (Math.random()*100);;
}
}