import java.rmi.*;
import java.rmi.server.*;
import java.rmi.registry.*;
public class Server extends UnicastRemoteObject implements ServerInterface {
public Server() throws RemoteException { // constructor does nothing...
System.out.println("Server being initialized...");
} // its only purpose is to acknowledge the exception at creation time
public synchronized int register(ClientInterface client) throws RemoteException {
size++;
return size;
}
int size = -1;
public static void main(String[] args) {
}
} |