use of examples.mvc.rmi.duplex.ADistributedInheritingRMICounter in project GIPC by pdewan.
the class ACounterSessionMember method init.
protected static void init(String aMyName, int aPortNumber) {
gipcRegistry = GIPCLocateSessionRegistry.createOrGetSessionRegistry("mysession", "localhost", aPortNumber, aMyName, sessionChoice, numMembersToWaitFor);
counter = new ADistributedInheritingRMICounter();
gipcRegistry.rebind(COUNTER_NAME, counter);
groupRPCSessionPort = gipcRegistry.getSessionPort();
}
use of examples.mvc.rmi.duplex.ADistributedInheritingRMICounter in project GIPC by pdewan.
the class AnRMIRepositoryClientLauncher method main.
public static void main(String[] args) {
try {
Registry rmiRegistry = LocateRegistry.getRegistry();
RemoteRepository counterRepository = (RemoteRepository) rmiRegistry.lookup(COUNTER_REPOSITORY);
DistributedRMICounter exportedCounter = new ADistributedInheritingRMICounter();
UnicastRemoteObject.exportObject(exportedCounter, 0);
counterRepository.deposit(exportedCounter);
exportedCounter.increment(1);
List<Remote> objects = counterRepository.getObjects();
for (Remote counter : objects) {
System.out.println(((DistributedRMICounter) counter).getValue());
System.out.println(counter == exportedCounter);
System.out.println(counter.equals(exportedCounter));
}
} catch (Exception e) {
e.printStackTrace();
}
}
use of examples.mvc.rmi.duplex.ADistributedInheritingRMICounter in project GIPC by pdewan.
the class AGIPCCounterServer method main.
public static void main(String[] args) {
try {
GIPCRegistry gipcRegistry = GIPCLocateRegistry.createRegistry(SERVER_PORT);
DistributedRMICounter counter1 = new ADistributedInheritingRMICounter();
DistributedRMICounter counter2 = new ADistributedInheritingRMICounter();
gipcRegistry.rebind(COUNTER1, counter1);
gipcRegistry.rebind(COUNTER2, counter2);
DistributedRMICounter fetchedCounter = (DistributedRMICounter) gipcRegistry.lookup(DistributedRMICounter.class, COUNTER1);
AnRMICounterServer.doOperations(counter1, counter2, fetchedCounter);
} catch (Exception e) {
e.printStackTrace();
}
}
use of examples.mvc.rmi.duplex.ADistributedInheritingRMICounter in project GIPC by pdewan.
the class AnRMICounterServer method main.
public static void main(String[] args) {
try {
Registry rmiRegistry = LocateRegistry.getRegistry();
DistributedRMICounter counter1 = new ADistributedInheritingRMICounter();
DistributedRMICounter counter2 = new ADistributedInheritingRMICounter();
UnicastRemoteObject.exportObject(counter1, 0);
UnicastRemoteObject.exportObject(counter2, 0);
rmiRegistry.rebind(COUNTER1, counter1);
rmiRegistry.rebind(COUNTER2, counter2);
DistributedRMICounter fetchedCounter = (DistributedRMICounter) rmiRegistry.lookup(COUNTER1);
doOperations(counter1, counter2, fetchedCounter);
} catch (Exception e) {
e.printStackTrace();
}
}
use of examples.mvc.rmi.duplex.ADistributedInheritingRMICounter in project GIPC by pdewan.
the class ASimpleRMIRegistryAndCounterServer method main.
public static void main(String[] args) {
try {
Registry rmiRegistry = LocateRegistry.createRegistry(SERVER_PORT);
DistributedRMICounter counter = new ADistributedInheritingRMICounter();
UnicastRemoteObject.exportObject(counter, 0);
rmiRegistry.rebind(COUNTER_NAME, counter);
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations