use of sessionport.rpc.duplex.DuplexRPCSessionPort in project GIPC by pdewan.
the class ADuplexRPCDirectSessionPortLauncher method launchSessionPartipant.
public static void launchSessionPartipant(String anId, String aName, ParticipantChoice aChoice) {
// Tracer.showInfo(true);
ObjectDuplexSessionPortSelector.setDuplexSessionPortFactory(new ADirectObjectDuplexSessionPortFactory());
// ObjectDuplexSessionPortSelector.setDuplexSessionPortFactory(
// new ARelayingObjectDuplexSessionPortFactory());
DuplexRPCSessionPort sessionPort = DuplexRPCSessionPortSelector.createDuplexRPCSessionPort("localhost", "" + SESSION_SERVER_PORT, SESSION_SERVER_NAME, "Test Session", anId, aName, aChoice);
// DuplexRPCSessionPort sessionPort = DuplexRPCSessionPortSelector.createDuplexRPCSessionPort("localhost",
// "" + SESSION_SERVER_PORT, aSessionServerName, "Test Session", anId, aName,
// aChoice
// );
ConnectionListener connectListener = new ACallingConnectListener(sessionPort);
sessionPort.addConnectionListener(connectListener);
Adder adder = new AnAdder();
sessionPort.register(Adder.class, adder);
sessionPort.connect();
}
use of sessionport.rpc.duplex.DuplexRPCSessionPort in project GIPC by pdewan.
the class AModularDuplexRPCRelayedSessionPortLauncher method registerRemoteObjects.
protected void registerRemoteObjects() {
DuplexRPCSessionPort aSessionPort = (DuplexRPCSessionPort) mainPort;
Adder adder = new AnAdder();
aSessionPort.register(Adder.class, adder);
}
use of sessionport.rpc.duplex.DuplexRPCSessionPort in project GIPC by pdewan.
the class AModularDuplexRPCDirectSessionPortLauncher method registerRemoteObjects.
protected void registerRemoteObjects() {
DuplexRPCSessionPort aSessionPort = (DuplexRPCSessionPort) mainPort;
Adder adder = new AnAdder();
aSessionPort.register(Adder.class, adder);
}
use of sessionport.rpc.duplex.DuplexRPCSessionPort in project GIPC by pdewan.
the class ADuplexRPCRelayedSessionPortLauncher method launchSessionPartipant.
public static void launchSessionPartipant(String anId, String aName, ParticipantChoice aChoice) {
// Tracer.showInfo(true);
// ObjectDuplexSessionPortSelector.setDuplexSessionPortFactory(
// new ADirectObjectDuplexSessionPortFactory());
// ObjectDuplexSessionPortSelector.setDuplexSessionPortFactory(
// new ARelayingObjectDuplexSessionPortFactory());
DuplexRPCSessionPort sessionPort = DuplexRPCSessionPortSelector.createDuplexRPCSessionPort("localhost", "" + SESSION_SERVER_PORT, SESSION_SERVER_NAME, "Test Session", anId, aName, aChoice);
// DuplexRPCSessionPort sessionPort = DuplexRPCSessionPortSelector.createDuplexRPCSessionPort("localhost",
// "" + SESSION_SERVER_PORT, aSessionServerName, "Test Session", anId, aName,
// aChoice
// );
ConnectionListener connectListener = new ACallingConnectListener(sessionPort);
sessionPort.addConnectionListener(connectListener);
Adder adder = new AnAdder();
sessionPort.register(Adder.class, adder);
sessionPort.connect();
}
use of sessionport.rpc.duplex.DuplexRPCSessionPort in project GIPC by pdewan.
the class ASessionPortCounterClientLauncher method createUI.
@Override
protected void createUI(InputPort anInputPort) {
Scanner aScanner = new Scanner(System.in);
for (; ; ) {
System.out.println("Enter user name whose counter is to be incremented:");
String aName = aScanner.nextLine();
Counter aCounter = (Counter) DirectedRPCProxyGenerator.generateRPCProxy((DuplexRPCSessionPort) mainPort, aName, ACounter.class, null);
aCounter.increment(1);
System.out.println("New counter value:" + aCounter.getValue());
}
}
Aggregations