Search in sources :

Example 11 with DistributedRMICounter

use of examples.mvc.rmi.duplex.DistributedRMICounter in project GIPC by pdewan.

the class AMultiUserRMIUpperCaser method getCounterProxy.

protected DistributedRMICounter getCounterProxy(String aUserName) {
    try {
        DistributedRMICounter counter = nameToCounter.get(aUserName);
        if (counter == null) {
            Registry rmiRegistry = LocateRegistry.getRegistry();
            counter = (DistributedRMICounter) rmiRegistry.lookup(aUserName + DistributedRMICounter.class.getName());
            nameToCounter.put(aUserName, counter);
        }
        return counter;
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }
}
Also used : DistributedRMICounter(examples.mvc.rmi.duplex.DistributedRMICounter) LocateRegistry(java.rmi.registry.LocateRegistry) Registry(java.rmi.registry.Registry)

Aggregations

DistributedRMICounter (examples.mvc.rmi.duplex.DistributedRMICounter)11 LocateRegistry (java.rmi.registry.LocateRegistry)8 Registry (java.rmi.registry.Registry)8 ADistributedInheritingRMICounter (examples.mvc.rmi.duplex.ADistributedInheritingRMICounter)4 ADistributedDelegatingRMICounter (examples.mvc.rmi.duplex.ADistributedDelegatingRMICounter)1 GIPCRegistry (inputport.rpc.GIPCRegistry)1 Remote (java.rmi.Remote)1 RemoteException (java.rmi.RemoteException)1