Search in sources :

Example 1 with ADistributedDelegatingRMICounter

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();
    }
}
Also used : DistributedRMICounter(examples.mvc.rmi.duplex.DistributedRMICounter) LocateRegistry(java.rmi.registry.LocateRegistry) Registry(java.rmi.registry.Registry) ADistributedDelegatingRMICounter(examples.mvc.rmi.duplex.ADistributedDelegatingRMICounter)

Aggregations

ADistributedDelegatingRMICounter (examples.mvc.rmi.duplex.ADistributedDelegatingRMICounter)1 DistributedRMICounter (examples.mvc.rmi.duplex.DistributedRMICounter)1 LocateRegistry (java.rmi.registry.LocateRegistry)1 Registry (java.rmi.registry.Registry)1