use of examples.mvc.rmi.duplex.ADistributedDelegatingRMICounter in project GIPC by pdewan.
the class RemoteCounterServerLauncher method main.
public static void main(String[] args) {
try {
Registry rmiRegistry = LocateRegistry.getRegistry();
DistributedRMICounter counter = new ADistributedDelegatingRMICounter();
// this is what sends a remote rather than serializable version of the object
UnicastRemoteObject.exportObject(counter, 0);
// rmiRegistry.rebind(Counter.class.getName(), exportedCounter);
rmiRegistry.rebind(DistributedRMICounter.class.getName(), counter);
counter.increment(50);
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations