use of port.sessionserver.SessionServer in project GIPC by pdewan.
the class AReplicatedSessionServerLauncher method launchServer.
public static void launchServer(String aSessionServerName, String aSessionServerPort) {
Tracer.showInfo(true);
DuplexRPCServerInputPort serverInputPort = DuplexRPCInputPortSelector.createDuplexRPCServerInputPort("" + aSessionServerPort, aSessionServerName);
DuplexSingleResponseUtlity.supportSingleResponse(serverInputPort);
SessionServer sessionServer = new ASessionServer(serverInputPort);
// RelayerSupportingSessionsServer sessionServer = new ARelayerSupportingSessionsServer(serverInputPort);
serverInputPort.register(RelayerSupportingSessionServer.class, sessionServer);
serverInputPort.register(AFaultTolerantSessionPortLauncher.SESSION_SERVER_NAME, sessionServer);
serverInputPort.connect();
}
use of port.sessionserver.SessionServer in project GIPC by pdewan.
the class AnOldSessionClientLauncher method launch.
public static void launch(String myHost, String myID, String myName) {
GroupRPCServerInputPort serverInputPort = GroupRPCInputPortSelector.createGroupRPCServerInputPort(myID, myName);
Adder adder = new AnAdder();
serverInputPort.register(Adder.class, adder);
serverInputPort.connect();
// SessionObserver observer = new APrintingSessionObserver();
SessionObserver observer = new AJoinerConnectingSessionObserver(myName);
ServerPortDescription sessionClientDescription = new AServerPortDescription(myHost, myID, myName);
DuplexRPCClientInputPort clientInputPort = DuplexRPCInputPortSelector.createDuplexRPCClientInputPort("localhost", "" + SESSION_SERVER_PORT, SESSION_SERVER_NAME, myName);
clientInputPort.connect();
try {
SessionServer sessionServerProxy = (SessionServer) DirectedRPCProxyGenerator.generateRPCProxy(clientInputPort, null, SessionServer.class, null);
Object retVal = sessionServerProxy.join("Test Session", sessionClientDescription, observer);
System.out.println(retVal);
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations