use of sessionport.rpc.duplex.relayed.example.ACallingConnectListener 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();
}
Aggregations